summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt142
-rw-r--r--test/CMakeTests.cmake15
-rw-r--r--test/CMakeVFDTests.cmake35
-rw-r--r--test/Makefile.am30
-rw-r--r--test/SWMR_POSIX_Order_UG.txt4
-rw-r--r--test/SWMR_UseCase_UG.txt6
-rw-r--r--test/ShellTests.cmake39
-rw-r--r--test/accum.c6
-rw-r--r--test/accum_swmr_reader.c2
-rw-r--r--test/app_ref.c28
-rw-r--r--test/atomic_writer.c2
-rw-r--r--test/big.c10
-rw-r--r--test/btree2.c140
-rw-r--r--test/cache.c71
-rw-r--r--test/cache_api.c57
-rw-r--r--test/cache_common.c162
-rw-r--r--test/cache_common.h4
-rw-r--r--test/cache_image.c33
-rw-r--r--test/cache_tagging.c52
-rw-r--r--test/chunk_info.c6
-rw-r--r--test/cmpd_dset.c14
-rw-r--r--test/cork.c23
-rw-r--r--test/dangle.c16
-rw-r--r--test/del_many_dense_attrs.c4
-rw-r--r--test/direct_chunk.c14
-rw-r--r--test/dsets.c81
-rw-r--r--test/dt_arith.c26
-rw-r--r--test/dtransform.c21
-rw-r--r--test/dtypes.c112
-rw-r--r--test/earray.c27
-rw-r--r--test/enc_dec_plist.c4
-rw-r--r--test/enc_dec_plist_cross_platform.c2
-rw-r--r--test/enum.c2
-rw-r--r--test/error_test.c20
-rw-r--r--test/event_set.c513
-rw-r--r--test/external.c10
-rw-r--r--test/external_common.c8
-rw-r--r--test/family_v16-000000.h5 (renamed from test/family_v16_00000.h5)bin5120 -> 5120 bytes
-rw-r--r--test/family_v16-000001.h5 (renamed from test/family_v16_00001.h5)bin5120 -> 5120 bytes
-rw-r--r--test/family_v16-000002.h5 (renamed from test/family_v16_00002.h5)bin5120 -> 5120 bytes
-rw-r--r--test/family_v16-000003.h5 (renamed from test/family_v16_00003.h5)bin4048 -> 4048 bytes
-rw-r--r--test/farray.c12
-rw-r--r--test/fheap.c156
-rw-r--r--test/file_image.c13
-rw-r--r--test/filenotclosed.c2
-rw-r--r--test/fillval.c9
-rw-r--r--test/filter_fail.c4
-rw-r--r--test/filter_plugin1_dsets.c2
-rw-r--r--test/filter_plugin3_dsets.c2
-rw-r--r--test/flush1.c4
-rw-r--r--test/flush2.c4
-rw-r--r--test/flushrefresh.c18
-rw-r--r--test/freespace.c28
-rw-r--r--test/gen_bounds.c12
-rw-r--r--test/gen_new_array.c4
-rw-r--r--test/gen_old_group.c2
-rw-r--r--test/gen_plist.c2
-rw-r--r--test/genall5.c2
-rw-r--r--test/getname.c10
-rw-r--r--test/gheap.c2
-rw-r--r--test/h5test.c402
-rw-r--r--test/h5test.h71
-rw-r--r--test/lheap.c40
-rw-r--r--test/links.c192
-rw-r--r--test/links_env.c16
-rw-r--r--test/mf.c245
-rw-r--r--test/mirror_vfd.c2
-rw-r--r--test/mount.c4
-rw-r--r--test/mtime.c103
-rw-r--r--test/ntypes.c16
-rw-r--r--test/null_vfd_plugin.c162
-rw-r--r--test/null_vfd_plugin.h33
-rw-r--r--test/objcopy.c53
-rw-r--r--test/ohdr.c32
-rw-r--r--test/page_buffer.c44
-rw-r--r--test/reserved.c8
-rw-r--r--test/ros3.c2
-rw-r--r--test/s3comms.c26
-rw-r--r--test/set_extent.c57
-rw-r--r--test/stab.c22
-rw-r--r--test/swmr.c58
-rw-r--r--test/swmr_addrem_writer.c2
-rw-r--r--test/swmr_check_compat_vfd.c53
-rw-r--r--test/swmr_generator.c4
-rw-r--r--test/swmr_reader.c2
-rw-r--r--test/swmr_remove_reader.c2
-rw-r--r--test/swmr_remove_writer.c2
-rw-r--r--test/swmr_sparse_reader.c3
-rw-r--r--test/swmr_sparse_writer.c2
-rw-r--r--test/swmr_start_write.c6
-rw-r--r--test/swmr_writer.c2
-rw-r--r--test/tarray.c6
-rw-r--r--test/tattr.c273
-rw-r--r--test/tcoords.c2
-rw-r--r--test/test_usecases.sh.in31
-rw-r--r--test/testcheck_version.sh.in4
-rw-r--r--test/testflushrefresh.sh.in17
-rw-r--r--test/testhdf5.c2
-rw-r--r--test/testlibinfo.sh.in2
-rw-r--r--test/testmeta.c2
-rw-r--r--test/testswmr.pwsh.in519
-rw-r--r--test/testswmr.sh.in62
-rw-r--r--test/testvdsswmr.pwsh.in190
-rw-r--r--test/testvdsswmr.sh.in28
-rw-r--r--test/testvfdswmr.sh.in240
-rw-r--r--test/tfile.c936
-rw-r--r--test/tgenprop.c18
-rw-r--r--test/th5o.c119
-rw-r--r--test/th5s.c4
-rw-r--r--test/tid.c4
-rw-r--r--test/titerate.c6
-rw-r--r--test/tmisc.c104
-rw-r--r--test/trefer.c16
-rw-r--r--test/trefstr.c10
-rw-r--r--test/tselect.c109
-rw-r--r--test/tsohm.c54
-rw-r--r--test/ttsafe.c2
-rw-r--r--test/ttsafe_attr_vlen.c2
-rw-r--r--test/tvlstr.c10
-rw-r--r--test/tvltypes.c2
-rw-r--r--test/twriteorder.c8
-rw-r--r--test/unlink.c6
-rw-r--r--test/unregister.c2
-rw-r--r--test/use_append_chunk.c6
-rw-r--r--test/use_append_mchunks.c6
-rw-r--r--test/use_common.c4
-rw-r--r--test/use_disable_mdc_flushes.c2
-rw-r--r--test/vds.c33
-rw-r--r--test/vds_env.c24
-rw-r--r--test/vfd.c580
-rw-r--r--test/vfd_plugin.c439
-rw-r--r--test/vfd_swmr.c44
-rw-r--r--test/vfd_swmr_attrdset_writer.c6
-rw-r--r--test/vfd_swmr_bigset_writer.c8
-rw-r--r--test/vfd_swmr_check_compat.c61
-rw-r--r--test/vfd_swmr_dsetchks_writer.c13
-rw-r--r--test/vfd_swmr_dsetops_writer.c2
-rw-r--r--test/vfd_swmr_generator.c2
-rw-r--r--test/vfd_swmr_gfail_writer.c6
-rw-r--r--test/vfd_swmr_gperf_writer.c16
-rw-r--r--test/vfd_swmr_group_writer.c22
-rw-r--r--test/vfd_swmr_indep_rw_writer.c2
-rw-r--r--test/vfd_swmr_zoo_writer.c2
-rw-r--r--test/vol.c71
-rw-r--r--test/vol_plugin.c4
145 files changed, 5332 insertions, 2506 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 61f11a9..22034c8 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -89,7 +89,7 @@ if (HDF5_ENABLE_FORMATTERS)
endif ()
#################################################################################
-# If filter and vol plugin tests can be tested
+# If filter, vfd and vol plugin tests can be tested
#################################################################################
if (BUILD_SHARED_LIBS)
# make plugins dir
@@ -173,6 +173,50 @@ if (BUILD_SHARED_LIBS)
endforeach ()
#################################################################################
+ # make vfd plugins dir
+ #################################################################################
+ file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/null_vfd_plugin_dir")
+
+ #-----------------------------------------------------------------------------
+ # Define VFD Plugin Test Sources
+ #-----------------------------------------------------------------------------
+ set (VFD_PLUGIN_LIBS
+ null_vfd_plugin
+ )
+
+ foreach (vfd_lib ${VFD_PLUGIN_LIBS})
+ set (HDF5_VFD_PLUGIN_LIB_CORENAME "${vfd_lib}")
+ set (HDF5_VFD_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_VFD_PLUGIN_LIB_CORENAME}")
+ set (HDF5_VFD_PLUGIN_LIB_TARGET ${HDF5_VFD_PLUGIN_LIB_CORENAME})
+
+ add_library (${HDF5_VFD_PLUGIN_LIB_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${vfd_lib}.c)
+ target_include_directories (${HDF5_VFD_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${HDF5_VFD_PLUGIN_LIB_TARGET} SHARED)
+ target_link_libraries (${HDF5_VFD_PLUGIN_LIB_TARGET} PUBLIC ${HDF5_TEST_LIBSH_TARGET})
+ H5_SET_LIB_OPTIONS (${HDF5_VFD_PLUGIN_LIB_TARGET} ${HDF5_VFD_PLUGIN_LIB_NAME} SHARED "LIB")
+ set_target_properties (${HDF5_VFD_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN)
+
+ #-----------------------------------------------------------------------------
+ # Add Target to clang-format
+ #-----------------------------------------------------------------------------
+ if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_TEST_${HDF5_VFD_PLUGIN_LIB_TARGET}_FORMAT ${HDF5_VFD_PLUGIN_LIB_TARGET})
+ endif ()
+
+ #-----------------------------------------------------------------------------
+ # Copy VFD plugin to a plugins folder
+ #-----------------------------------------------------------------------------
+ add_custom_command (
+ TARGET ${HDF5_VFD_PLUGIN_LIB_TARGET}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different
+ "$<TARGET_FILE:${HDF5_VFD_PLUGIN_LIB_TARGET}>"
+ "${CMAKE_BINARY_DIR}/null_vfd_plugin_dir/$<TARGET_FILE_NAME:${HDF5_VFD_PLUGIN_LIB_TARGET}>"
+ )
+ endforeach ()
+
+ #################################################################################
# make vol plugins dir
#################################################################################
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/null_vol_plugin_dir")
@@ -334,7 +378,7 @@ set (H5_TESTS
ros3
s3comms
hdfs
- mirror_vfd
+ #mirror_vfd # multiple source
ntypes
dangle
dtransform
@@ -356,6 +400,9 @@ set (H5_TESTS
event_set
vfd_swmr
)
+if (HDF5_BUILD_UTILS)
+ set (H5_TESTS ${H5_TESTS} mirror_vfd)
+endif ()
macro (ADD_H5_EXE file)
add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c)
@@ -530,30 +577,25 @@ if (HDF5_ENABLE_FORMATTERS)
clang_format (HDF5_TEST_thread_id_FORMAT thread_id)
endif ()
-#-- Adding test for mirror_vfd
-add_executable (mirror_vfd ${mirror_vfd_SOURCES})
-target_include_directories (mirror_vfd PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_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)
-
-#-----------------------------------------------------------------------------
-# Add Target to clang-format
-#-----------------------------------------------------------------------------
-if (HDF5_ENABLE_FORMATTERS)
- clang_format (HDF5_TEST_mirror_vfd_FORMAT mirror_vfd)
-endif ()
+if (HDF5_BUILD_UTILS) # requires mirror server
+ #-- Adding test for mirror_vfd
+ add_executable (mirror_vfd ${mirror_vfd_SOURCES})
+ target_include_directories (mirror_vfd PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_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)
-#-----------------------------------------------------------------------------
-# Add Target to clang-format
-#-----------------------------------------------------------------------------
-if (HDF5_ENABLE_FORMATTERS)
- clang_format (HDF5_TEST_event_set_FORMAT event_set)
+ #-----------------------------------------------------------------------------
+ # Add Target to clang-format
+ #-----------------------------------------------------------------------------
+ if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_TEST_mirror_vfd_FORMAT mirror_vfd)
+ endif ()
endif ()
##############################################################################
@@ -595,7 +637,6 @@ endif ()
set (H5_SWMR_TESTS
swmr_addrem_writer
- swmr_check_compat_vfd
swmr_generator
swmr_reader
swmr_remove_reader
@@ -702,6 +743,19 @@ if (BUILD_SHARED_LIBS)
clang_format (HDF5_TEST_filter_plugin_FORMAT filter_plugin)
endif ()
+ add_executable (vfd_plugin ${HDF5_TEST_SOURCE_DIR}/vfd_plugin.c)
+ target_include_directories (vfd_plugin PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (vfd_plugin SHARED)
+ target_link_libraries (vfd_plugin PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ set_target_properties (vfd_plugin PROPERTIES FOLDER test)
+
+ #-----------------------------------------------------------------------------
+ # Add Target to clang-format
+ #-----------------------------------------------------------------------------
+ if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_TEST_vfd_plugin_FORMAT vfd_plugin)
+ endif ()
+
add_executable (vol_plugin ${HDF5_TEST_SOURCE_DIR}/vol_plugin.c)
target_include_directories (vol_plugin PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (vol_plugin SHARED)
@@ -739,24 +793,26 @@ if (HDF5_ENABLE_FORMATTERS)
clang_format (HDF5_TEST_use_append_chunk_FORMAT use_append_chunk)
endif ()
-set (use_append_chunk_mirror_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk_mirror.c ${HDF5_TEST_SOURCE_DIR}/use_common.c ${HDF5_TEST_SOURCE_DIR}/use.h)
-add_executable (use_append_chunk_mirror ${use_append_chunk_mirror_SOURCES})
-target_compile_options(use_append_chunk_mirror PRIVATE "${HDF5_CMAKE_C_FLAGS}")
-target_include_directories (use_append_chunk_mirror 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_mirror STATIC)
- target_link_libraries (use_append_chunk_mirror PRIVATE ${HDF5_TEST_LIB_TARGET})
-else ()
- TARGET_C_PROPERTIES (use_append_chunk_mirror SHARED)
- target_link_libraries (use_append_chunk_mirror PRIVATE ${HDF5_TEST_LIBSH_TARGET})
-endif ()
-set_target_properties (use_append_chunk_mirror PROPERTIES FOLDER test)
+if (HDF5_BUILD_UTILS) # requires mirror server
+ set (use_append_chunk_mirror_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk_mirror.c ${HDF5_TEST_SOURCE_DIR}/use_common.c ${HDF5_TEST_SOURCE_DIR}/use.h)
+ add_executable (use_append_chunk_mirror ${use_append_chunk_mirror_SOURCES})
+ target_compile_options(use_append_chunk_mirror PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+ target_include_directories (use_append_chunk_mirror 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_mirror STATIC)
+ target_link_libraries (use_append_chunk_mirror PRIVATE ${HDF5_TEST_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (use_append_chunk_mirror SHARED)
+ target_link_libraries (use_append_chunk_mirror PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ endif ()
+ set_target_properties (use_append_chunk_mirror PROPERTIES FOLDER test)
-#-----------------------------------------------------------------------------
-# Add Target to clang-format
-#-----------------------------------------------------------------------------
-if (HDF5_ENABLE_FORMATTERS)
- clang_format (HDF5_TEST_use_append_chunk_mirror_FORMAT use_append_chunk_mirror)
+ #-----------------------------------------------------------------------------
+ # Add Target to clang-format
+ #-----------------------------------------------------------------------------
+ if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_TEST_use_append_chunk_mirror_FORMAT use_append_chunk_mirror)
+ endif ()
endif ()
set (use_append_mchunks_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_mchunks.c ${HDF5_TEST_SOURCE_DIR}/use_common.c ${HDF5_TEST_SOURCE_DIR}/use.h)
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index bb5356d..4e828f8 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -127,10 +127,10 @@ set (HDF5_REFERENCE_TEST_FILES
btree_idx_1_8.h5
corrupt_stab_msg.h5
deflate.h5
- family_v16_00000.h5
- family_v16_00001.h5
- family_v16_00002.h5
- family_v16_00003.h5
+ family_v16-000000.h5
+ family_v16-000001.h5
+ family_v16-000002.h5
+ family_v16-000003.h5
file_image_core_test.h5
filespace_1_6.h5
filespace_1_8.h5
@@ -331,7 +331,7 @@ set (test_CLEANFILES
sec2_file.h5
direct_file.h5
family_file000*.h5
- new_family_v16_000*.h5
+ new_family_v16-000*.h5
multi_file-*.h5
core_file
filter_plugin.h5
@@ -649,10 +649,11 @@ set_tests_properties (H5TEST-tcheck_version-minor PROPERTIES
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
WILL_FAIL "true"
)
-# release + 1 should pass
+# release + 1 should pass on non-develop branches
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"
)
##############################################################################
@@ -879,8 +880,6 @@ if (ENABLE_EXTENDED_TESTS)
# 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")
if (H5_PERL_FOUND)
diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake
index 892ccf3..e08e4d2 100644
--- a/test/CMakeVFDTests.cmake
+++ b/test/CMakeVFDTests.cmake
@@ -16,22 +16,10 @@
##############################################################################
##############################################################################
# included from CMakeTests.cmake
+H5_CREATE_VFD_DIR()
-set (VFD_LIST
- sec2
- stdio
- core
- core_paged
- split
- multi
- family
-)
-if (H5_HAVE_DIRECT)
- set (VFD_LIST ${VFD_LIST} direct)
-endif ()
-
+# create more test folders for each VFD
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 ()
@@ -208,3 +196,22 @@ add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HD
foreach (h5_vfd ${VFD_LIST})
ADD_VFD_TEST (${h5_vfd} 0)
endforeach ()
+
+ ##############################################################################
+ ### V F D P L U G I N T E S T S
+ ##############################################################################
+ if (BUILD_SHARED_LIBS)
+ if (WIN32)
+ set (CMAKE_SEP "\;")
+ set (BIN_REL_PATH "../../")
+ else ()
+ set (CMAKE_SEP ":")
+ set (BIN_REL_PATH "../")
+ endif ()
+
+ add_test (NAME H5PLUGIN-vfd_plugin COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:vfd_plugin>)
+ set_tests_properties (H5PLUGIN-vfd_plugin PROPERTIES
+ ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/null_vfd_plugin_dir;srcdir=${HDF5_TEST_BINARY_DIR}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}
+ )
+ endif ()
diff --git a/test/Makefile.am b/test/Makefile.am
index f7ed4c6..2a22ac4 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -37,8 +37,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_builddir)/src
# 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 \
- testvfdswmr.sh \
- test_mirror.sh
+ testvfdswmr.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) \
@@ -57,13 +56,16 @@ SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) \
vfd_swmr_gperf_reader$(EXEEXT) vfd_swmr_gperf_writer$(EXEEXT) \
vfd_swmr_gfail_reader$(EXEEXT) vfd_swmr_gfail_writer$(EXEEXT) \
vfd_swmr_indep_wr_p0$(EXEEXT) vfd_swmr_indep_wr_p1$(EXEEXT) \
- vds_env$(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_filter_plugin.sh test_vol_plugin.sh
SCRIPT_DEPEND += filter_plugin$(EXEEXT) vol_plugin$(EXEEXT)
endif
+if MIRROR_VFD_CONDITIONAL
+ TEST_SCRIPT += test_mirror.sh
+endif
+
check_SCRIPTS = $(TEST_SCRIPT)
# These are our main targets. They should be listed in the order to be
@@ -117,12 +119,14 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \
vfd_swmr_gperf_reader vfd_swmr_gperf_writer \
vfd_swmr_gfail_reader vfd_swmr_gfail_writer \
vfd_swmr_indep_wr_p0 vfd_swmr_indep_wr_p1 \
- vfd_swmr_check_compat \
vfd_swmr_dsetchks_reader vfd_swmr_dsetchks_writer \
- swmr_check_compat_vfd vds_env vds_swmr_gen vds_swmr_reader vds_swmr_writer \
- mirror_vfd
+ vds_env vds_swmr_gen vds_swmr_reader vds_swmr_writer
if HAVE_SHARED_CONDITIONAL
- check_PROGRAMS+= filter_plugin vol_plugin
+ check_PROGRAMS+= filter_plugin vfd_plugin vol_plugin
+endif
+
+if MIRROR_VFD_CONDITIONAL
+ check_PROGRAMS+= mirror_vfd
endif
# These programs generate test files for the tests. They don't need to be
@@ -145,7 +149,7 @@ if HAVE_SHARED_CONDITIONAL
# 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
+ noinst_LTLIBRARIES=libh5test.la libfilter_plugin1_dsets.la libfilter_plugin2_dsets.la libfilter_plugin3_dsets.la libfilter_plugin4_groups.la libnull_vfd_plugin.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
@@ -157,6 +161,12 @@ if HAVE_SHARED_CONDITIONAL
libfilter_plugin3_dsets_la_LIBADD=$(LIBHDF5)
libfilter_plugin4_groups_la_LIBADD=$(LIBHDF5)
+ # VFD plugin test libraries
+ #
+ # null_vfd_plugin is used for testing basic VFD plugin functionality.
+ libnull_vfd_plugin_la_SOURCES=null_vfd_plugin.c
+ libnull_vfd_plugin_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
+
# VOL plugin test libraries
#
# null_vol_connector is used for testing basic VOL plugin functionality.
@@ -238,7 +248,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse
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 \
+ family_file000[0-3][0-9].h5 new_family_v16-000[0-3][0-9].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 \
diff --git a/test/SWMR_POSIX_Order_UG.txt b/test/SWMR_POSIX_Order_UG.txt
index 2771af1..a4190bc 100644
--- a/test/SWMR_POSIX_Order_UG.txt
+++ b/test/SWMR_POSIX_Order_UG.txt
@@ -3,7 +3,7 @@ POSIX Write Order Test Instructions
Purpose
-------
-This documents shows the requirments, implementaion design and instructions
+This documents shows the requirements, implementation design and instructions
of building and running the POSIX Write Order test. The name of the
test is twriteorder and it resides in the test/ directory.
@@ -44,7 +44,7 @@ and they are ready for the reader processes to access.
If the system, in which the writer and reader processes run, the readers
will always get all chain-linked blocks correctly. If the order of write
-is not maintained, some reader processes may found unexpect block data.
+is not maintained, some reader processes may found unexpected block data.
Building the Tests
------------------
diff --git a/test/SWMR_UseCase_UG.txt b/test/SWMR_UseCase_UG.txt
index 1e3d1e6..677fdc4 100644
--- a/test/SWMR_UseCase_UG.txt
+++ b/test/SWMR_UseCase_UG.txt
@@ -2,7 +2,7 @@
User Guide for SWMR Use Case Programs
2. Purpose:
- This is a User Guide of the SWMR Use Case programs. It descibes the use
+ This is a User Guide of the SWMR Use Case programs. It describes the use
case program and explain how to run them.
2.1. Author and Dates:
@@ -87,7 +87,7 @@
It opens the HDF5 data file without the SWMR access mode (0 means
off). This likely will result in error. This option is provided for
- users to see the effect of the neede SWMR access mode for concurrent
+ users to see the effect of the needed SWMR access mode for concurrent
access.
3.4. Test Shell Script:
@@ -176,7 +176,7 @@
It opens the HDF5 data file without the SWMR access mode (0 means
off). This likely will result in error. This option is provided for
- users to see the effect of the neede SWMR access mode for concurrent
+ users to see the effect of the needed SWMR access mode for concurrent
access.
4.4. Test Shell Script:
diff --git a/test/ShellTests.cmake b/test/ShellTests.cmake
index 9614152..e7de735 100644
--- a/test/ShellTests.cmake
+++ b/test/ShellTests.cmake
@@ -15,12 +15,35 @@
### T E S T I N G S H E L L S C R I P T S ###
##############################################################################
-if (UNIX)
+find_program (PWSH NAMES pwsh powershell)
+if (PWSH)
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/usecases_test")
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/swmr_test")
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/vds_swmr_test")
+ set (srcdir ${HDF5_TEST_SOURCE_DIR})
+ set (H5_UTILS_TEST_BUILDDIR ${CMAKE_TEST_OUTPUT_DIRECTORY})
+ set (H5_TEST_BUILDDIR ${HDF5_TEST_BINARY_DIR}/H5TEST)
+ configure_file(${HDF5_TEST_SOURCE_DIR}/testswmr.pwsh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testswmr.ps1 @ONLY)
+ # test commented out as currently the programs are not allowing another access to the data file
+ #add_test (H5SHELL-testswmr ${PWSH} ${HDF5_TEST_BINARY_DIR}/H5TEST/testswmr.ps1)
+ #set_tests_properties (H5SHELL-testswmr PROPERTIES
+ # ENVIRONMENT "PATH=$ENV{PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
+ # WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ #)
+ configure_file(${HDF5_TEST_SOURCE_DIR}/testvdsswmr.pwsh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testvdsswmr.ps1 @ONLY)
+ # test commented out as currently the programs are not allowing another access to the data file
+ #add_test (H5SHELL-testvdsswmr ${PWSH} ${HDF5_TEST_BINARY_DIR}/H5TEST/testvdsswmr.ps1)
+ #set_tests_properties (H5SHELL-testvdsswmr PROPERTIES
+ # ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
+ # WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ #)
+elseif (UNIX)
find_program (SH_PROGRAM bash)
if (SH_PROGRAM)
set (srcdir ${HDF5_TEST_SOURCE_DIR})
- set (bindir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+ set (H5_UTILS_TEST_BUILDDIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+ set (H5_TEST_BUILDDIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
##############################################################################
# configure scripts to test dir
##############################################################################
@@ -34,22 +57,13 @@ if (UNIX)
##############################################################################
# copy test programs to test dir
##############################################################################
- #shell script creates dir
- #file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/swmr_test")
add_custom_command (
- TARGET swmr_check_compat_vfd
+ TARGET accum_swmr_reader
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"
)
- #shell script creates dir
- #file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/usecases_test")
-
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/swmr_test")
-
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/vds_swmr_test")
-
##############################################################################
##############################################################################
### A D D I T I O N A L T E S T S ###
@@ -105,6 +119,5 @@ if (UNIX)
ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
-
endif ()
endif ()
diff --git a/test/accum.c b/test/accum.c
index c3346bc..080edac 100644
--- a/test/accum.c
+++ b/test/accum.c
@@ -1348,7 +1348,7 @@ test_accum_adjust(H5F_t *f)
/* ==> Accumulator will try to resize, but see that it's getting too big */
/* ==> 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 */
+ /* ==> We can slide the dirty region down, to accommodate the request */
/* ==> Max Buffer Size - (dirty offset + adjust size) >= 2 * size) */
/* ==> Need to adjust location of accumulator while appending */
/* ==> Accumulator will need to be reallocated */
@@ -1394,7 +1394,7 @@ test_accum_adjust(H5F_t *f)
/* ==> Accumulator will try to resize, but see that it's getting too big */
/* ==> 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 */
+ /* ==> We can slide the dirty region down, to accommodate the request */
/* ==> 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)
@@ -2121,7 +2121,7 @@ test_swmr_write_big(hbool_t newest_format)
/* Skip this test if SWMR I/O is not supported for the VFD specified
* by the environment variable.
*/
- driver = HDgetenv("HDF5_DRIVER");
+ driver = HDgetenv(HDF5_DRIVER);
if (!H5FD__supports_swmr_test(driver)) {
SKIPPED();
HDputs(" Test skipped due to VFD not supporting SWMR I/O.");
diff --git a/test/accum_swmr_reader.c b/test/accum_swmr_reader.c
index ce0e830..76f45bf 100644
--- a/test/accum_swmr_reader.c
+++ b/test/accum_swmr_reader.c
@@ -56,7 +56,7 @@ main(void)
/* Skip this test if SWMR I/O is not supported for the VFD specified
* by the environment variable.
*/
- driver = HDgetenv("HDF5_DRIVER");
+ driver = HDgetenv(HDF5_DRIVER);
if (!H5FD__supports_swmr_test(driver))
return EXIT_SUCCESS;
diff --git a/test/app_ref.c b/test/app_ref.c
index 09cfb72..c4ac60c 100644
--- a/test/app_ref.c
+++ b/test/app_ref.c
@@ -69,8 +69,10 @@ Abrt_Handler(int H5_ATTR_UNUSED sig)
{
int i, n;
+ const char *string = " ID reference count: ";
for (i = 0; i < T_NUMCLASSES; i++) {
- HDfprintf(stderr, "%s ID reference count: %n", IDNAME[i], &n);
+ HDfprintf(stderr, "%s%s", IDNAME[i], string);
+ n = (int)(strlen(IDNAME[i]) + strlen(string));
HDfprintf(stderr, "%*d\n", (n < ERR_WIDTH) ? (ERR_WIDTH - n) : 0, rc[i]);
}
}
@@ -79,11 +81,12 @@ Abrt_Handler(int H5_ATTR_UNUSED sig)
int
main(void)
{
- hid_t ids[T_NUMCLASSES];
- hid_t fapl; /* File Access Property List */
- int ninc;
- int i;
- char filename[1024];
+ const char *env_h5_drvr; /* File Driver value from environment */
+ hid_t ids[T_NUMCLASSES];
+ hid_t fapl; /* File Access Property List */
+ int ninc;
+ int i;
+ char filename[1024];
h5_reset();
h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof filename);
@@ -92,6 +95,19 @@ main(void)
TESTING("library shutdown with reference count > 1");
+ /* Get the VFD to use */
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
+ if (env_h5_drvr == NULL)
+ env_h5_drvr = "nomatch";
+
+ /* Don't run this test with the multi/split VFD. A bug in library shutdown
+ * ordering causes problems with the multi VFD when IDs are left dangling.
+ */
+ if (!HDstrcmp(env_h5_drvr, "multi") || !HDstrcmp(env_h5_drvr, "split")) {
+ HDputs("\n -- SKIPPED for incompatible VFD --");
+ return 0;
+ }
+
/* Create the file */
if ((ids[T_FILE] = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
diff --git a/test/atomic_writer.c b/test/atomic_writer.c
index 5a6310a..33252f1 100644
--- a/test/atomic_writer.c
+++ b/test/atomic_writer.c
@@ -112,7 +112,7 @@ int
main(int argc, char *argv[])
{
int fd = -1; /* file descriptor */
- ssize_t bytes_wrote; /* the nubmer of bytes written */
+ ssize_t bytes_wrote; /* the number of bytes written */
unsigned int *buf = NULL; /* buffer to hold written data */
unsigned int n, u, i; /* local index variable */
int temp; /* temporary variable */
diff --git a/test/big.c b/test/big.c
index 6f8ce67..43fef56 100644
--- a/test/big.c
+++ b/test/big.c
@@ -43,7 +43,7 @@
* that disk space is allocated only when the contents are actually written.
* E.g., If one creates a new file, seeks forward 10 million bytes, writes
* 1 bytes and closes the file, then a sparse file, will show file size of
- * 10 million bytes but actaully uses only couple disk blocks, much smaller
+ * 10 million bytes but actually uses only couple disk blocks, much smaller
* than the formal file size.)
*
* One more consideration is that we want to distinguish an HDF5 library
@@ -70,7 +70,7 @@
#endif
/* Define Small, Large, Extra Large, Huge File which
- * corrspond to less than 2GB, 2GB, 4GB, and tens of GB file size.
+ * correspond to less than 2GB, 2GB, 4GB, and tens of GB file size.
* NO_FILE stands for "no file" to be tested.
*/
typedef enum fsizes_t { SFILE, LFILE, XLFILE, HUGEFILE, NO_FILE } fsizes_t;
@@ -607,9 +607,9 @@ usage(void)
"\t-fsize\tChange family size default to <fsize> where <fsize> is\n"
"\t\ta positive float point number. Default value is %" PRIuHSIZE ".\n"
"Examples:\n"
- "\tbig -fsize 2.1e9 \t# test with file size just under 2GB\n"
- "\tbig -fsize 2.2e9 \t# test with file size just above 2GB\n"
- "\tBe sure the file system can support the file size requested\n",
+ "\t big -fsize 2.1e9 \t# test with file size just under 2GB\n"
+ "\t big -fsize 2.2e9 \t# test with file size just above 2GB\n"
+ "\t Be sure the file system can support the file size requested\n",
(hsize_t)FAMILY_SIZE);
}
diff --git a/test/btree2.c b/test/btree2.c
index aca0c77..9cbb211 100644
--- a/test/btree2.c
+++ b/test/btree2.c
@@ -700,7 +700,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
if (H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
- /* Attempt to find non-existant record in B-tree with 1 record */
+ /* Attempt to find non-existent record in B-tree with 1 record */
/* (Should not be found, but not fail) */
idx = 41;
found = FALSE;
@@ -717,7 +717,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
if (found)
TEST_ERROR
- /* Attempt to find existant record in B-tree with 1 record */
+ /* Attempt to find existent record in B-tree with 1 record */
idx = 42;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
@@ -732,7 +732,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
if (!found)
TEST_ERROR
- /* Attempt to index non-existant record in B-tree with 1 record */
+ /* Attempt to index non-existent record in B-tree with 1 record */
idx = 0;
H5E_BEGIN_TRY
{
@@ -780,7 +780,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
if (H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
- /* Attempt to find non-existant record in level-0 B-tree with several records */
+ /* Attempt to find non-existent record in level-0 B-tree with several records */
/* (Should not be found, but not fail) */
idx = 41;
found = FALSE;
@@ -789,7 +789,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
if (found)
TEST_ERROR
- /* Attempt to find existant record in level-0 B-tree with several record */
+ /* Attempt to find existent record in level-0 B-tree with several record */
idx = 56;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
@@ -797,7 +797,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
if (!found)
TEST_ERROR
- /* Attempt to index non-existant record in B-tree with several records */
+ /* Attempt to index non-existent record in B-tree with several records */
idx = 0;
H5E_BEGIN_TRY
{
@@ -958,7 +958,7 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p
if (idx != (INSERT_SPLIT_ROOT_NREC + 2))
TEST_ERROR
- /* Attempt to find non-existant record in level-1 B-tree */
+ /* Attempt to find non-existent record in level-1 B-tree */
/* (Should not be found, but not fail) */
idx = INSERT_SPLIT_ROOT_NREC + 10;
found = FALSE;
@@ -967,7 +967,7 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p
if (found)
TEST_ERROR
- /* Attempt to find existant record in root of level-1 B-tree */
+ /* Attempt to find existent record in root of level-1 B-tree */
idx = 33;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
@@ -975,7 +975,7 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p
if (!found)
TEST_ERROR
- /* Attempt to find existant record in leaf of level-1 B-tree */
+ /* Attempt to find existent record in leaf of level-1 B-tree */
idx = 56;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
@@ -983,7 +983,7 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p
if (!found)
TEST_ERROR
- /* Attempt to index non-existant record in level-1 B-tree */
+ /* Attempt to index non-existent record in level-1 B-tree */
idx = 0;
H5E_BEGIN_TRY
{
@@ -1704,7 +1704,7 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (idx != ((INSERT_SPLIT_ROOT_NREC * 29) + 5))
TEST_ERROR
- /* Attempt to find non-existant record in level-2 B-tree */
+ /* Attempt to find non-existent record in level-2 B-tree */
/* (Should not be found, but not fail) */
idx = INSERT_SPLIT_ROOT_NREC * 30;
found = FALSE;
@@ -1713,7 +1713,7 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (found)
TEST_ERROR
- /* Attempt to find existant record in root of level-2 B-tree */
+ /* Attempt to find existent record in root of level-2 B-tree */
idx = 948;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
@@ -1726,7 +1726,7 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
- /* Attempt to find existant record in internal node of level-2 B-tree */
+ /* Attempt to find existent record in internal node of level-2 B-tree */
idx = 505;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
@@ -1739,7 +1739,7 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
- /* Attempt to find existant record in leaf of level-2 B-tree */
+ /* Attempt to find existent record in leaf of level-2 B-tree */
idx = 555;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
@@ -1752,7 +1752,7 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
- /* Attempt to index non-existant record in level-2 B-tree */
+ /* Attempt to index non-existent record in level-2 B-tree */
idx = 0;
H5E_BEGIN_TRY
{
@@ -3106,7 +3106,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
if (idx != INSERT_MANY)
TEST_ERROR
- /* Attempt to find non-existant record in level-4 B-tree */
+ /* Attempt to find non-existent record in level-4 B-tree */
/* (Should not be found, but not fail) */
idx = INSERT_MANY * 2;
found = FALSE;
@@ -3120,7 +3120,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
/* Pick random record */
idx = (hsize_t)(HDrandom() % INSERT_MANY);
- /* Attempt to find existant record in root of level-4 B-tree */
+ /* Attempt to find existent record in root of level-4 B-tree */
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
FAIL_STACK_ERROR
@@ -3128,7 +3128,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
TEST_ERROR
} /* end for */
- /* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */
+ /* Attempt to index non-existent record in level-4 B-tree, in increasing & decreasing order */
H5E_BEGIN_TRY
{
ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY * 3), find_cb, NULL);
@@ -3151,12 +3151,12 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
/* Pick random record */
idx = (hsize_t)(HDrandom() % INSERT_MANY);
- /* Attempt to find existant record in root of level-4 B-tree */
+ /* Attempt to find existent record in root of level-4 B-tree */
/* (in increasing order) */
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 */
+ /* Attempt to find existent record in root of level-4 B-tree */
/* (in decreasing order) */
if (H5B2_index(bt2, H5_ITER_DEC, idx, find_dec_cb, &idx) < 0)
FAIL_STACK_ERROR
@@ -3263,7 +3263,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
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 */
+ /* Attempt to find non-existent record in B-tree with 1 record */
/* (Should not be found, but not fail) */
find.key = 10;
find.val = (hsize_t)-1;
@@ -3285,7 +3285,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
if (found)
TEST_ERROR
- /* Attempt to find existant record in B-tree with 1 record */
+ /* Attempt to find existent record in B-tree with 1 record */
find.key = 42;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
@@ -3305,7 +3305,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
if (!found)
TEST_ERROR
- /* Attempt to index non-existant record in B-tree with 1 record */
+ /* Attempt to index non-existent record in B-tree with 1 record */
H5E_BEGIN_TRY
{
ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL);
@@ -3340,7 +3340,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
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 */
+ /* Attempt to find non-existent record in B-tree with 1 record */
/* (Should not be found, but not fail) */
find.key = 10;
find.val = (hsize_t)-1;
@@ -3382,7 +3382,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
if (!found)
TEST_ERROR
- /* Attempt to index non-existant record in B-tree with 1 record */
+ /* Attempt to index non-existent record in B-tree with 1 record */
H5E_BEGIN_TRY
{
ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL);
@@ -3437,7 +3437,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
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 */
+ /* Attempt to find non-existent record in level-0 B-tree with several records */
/* (Should not be found, but not fail) */
find.key = 10;
find.val = (hsize_t)-1;
@@ -3449,7 +3449,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
if (found)
TEST_ERROR
- /* Attempt to find existant record in level-0 B-tree with several records */
+ /* Attempt to find existent record in level-0 B-tree with several records */
find.key = 56;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
@@ -3459,7 +3459,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
if (!found)
TEST_ERROR
- /* Attempt to index non-existant record in B-tree with several records */
+ /* Attempt to index non-existent record in B-tree with several records */
H5E_BEGIN_TRY
{
ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL);
@@ -3531,7 +3531,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
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 */
+ /* Attempt to find non-existent record in level-0 B-tree with several records */
/* (Should not be found, but not fail) */
find.key = 41;
find.val = (hsize_t)-1;
@@ -3543,7 +3543,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
if (found)
TEST_ERROR
- /* Attempt to find existant record in level-0 B-tree with several record */
+ /* Attempt to find existent record in level-0 B-tree with several record */
find.key = 56;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
@@ -3553,7 +3553,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
if (!found)
TEST_ERROR
- /* Attempt to index non-existant record in B-tree with several records */
+ /* Attempt to index non-existent record in B-tree with several records */
H5E_BEGIN_TRY
{
ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL);
@@ -3782,7 +3782,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p
if (idx.key != (INSERT_SPLIT_ROOT_NREC_REC + 2))
TEST_ERROR
- /* Attempt to find non-existant record in level-1 B-tree */
+ /* Attempt to find non-existent record in level-1 B-tree */
/* (Should not be found, but not fail) */
find.key = 800;
find.val = (hsize_t)-1;
@@ -3794,7 +3794,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p
if (found)
TEST_ERROR
- /* Attempt to find existant record in root of level-1 B-tree */
+ /* Attempt to find existent record in root of level-1 B-tree */
find.key = 33;
find.val = (hsize_t)-1;
found = FALSE;
@@ -3807,7 +3807,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p
if (!found)
TEST_ERROR
- /* Attempt to find existant record in leaf of level-1 B-tree */
+ /* Attempt to find existent record in leaf of level-1 B-tree */
find.key = 56;
find.val = (hsize_t)-1;
found = FALSE;
@@ -3820,7 +3820,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p
if (!found)
TEST_ERROR
- /* Attempt to index non-existant record in level-1 B-tree */
+ /* Attempt to index non-existent record in level-1 B-tree */
H5E_BEGIN_TRY
{
ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC + 2), index_rec_cb, NULL);
@@ -4578,7 +4578,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (idx.key != ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 4))
TEST_ERROR
- /* Attempt to find non-existant record in level-2 B-tree */
+ /* Attempt to find non-existent record in level-2 B-tree */
/* (Should not be found, but not fail) */
find.key = INSERT_SPLIT_ROOT_NREC_REC * 42;
find.val = (hsize_t)-1;
@@ -4590,7 +4590,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (found)
TEST_ERROR
- /* Attempt to find existant record in root of level-2 B-tree */
+ /* Attempt to find existent record in root of level-2 B-tree */
find.key = 1347;
find.val = (hsize_t)-1;
found = FALSE;
@@ -4606,7 +4606,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
- /* Attempt to find existant record in internal node of level-2 B-tree */
+ /* Attempt to find existent record in internal node of level-2 B-tree */
find.key = 513;
find.val = (hsize_t)-1;
found = FALSE;
@@ -4622,7 +4622,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
- /* Attempt to find existant record in leaf of level-2 B-tree */
+ /* Attempt to find existent record in leaf of level-2 B-tree */
find.key = 555;
find.val = (hsize_t)-1;
found = FALSE;
@@ -4638,7 +4638,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
- /* Attempt to index non-existant record in level-2 B-tree */
+ /* Attempt to index non-existent record in level-2 B-tree */
H5E_BEGIN_TRY
{
ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL);
@@ -4755,7 +4755,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (idx.key != ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 4))
TEST_ERROR
- /* Attempt to find non-existant record in level-2 B-tree */
+ /* Attempt to find non-existent record in level-2 B-tree */
/* (Should not be found, but not fail) */
find.key = INSERT_SPLIT_ROOT_NREC_REC * 42;
find.val = (hsize_t)-1;
@@ -4767,7 +4767,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (found)
TEST_ERROR
- /* Attempt to find existant record in root of level-2 B-tree */
+ /* Attempt to find existent record in root of level-2 B-tree */
find.key = 1344;
find.val = (hsize_t)-1;
found = FALSE;
@@ -4783,7 +4783,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
- /* Attempt to find existant record in internal node of level-2 B-tree */
+ /* Attempt to find existent record in internal node of level-2 B-tree */
find.key = 512;
find.val = (hsize_t)-1;
found = FALSE;
@@ -4799,7 +4799,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
- /* Attempt to find existant record in leaf of level-2 B-tree */
+ /* Attempt to find existent record in leaf of level-2 B-tree */
find.key = 555;
find.val = (hsize_t)-1;
found = FALSE;
@@ -4815,7 +4815,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
- /* Attempt to index non-existant record in level-2 B-tree */
+ /* Attempt to index non-existent record in level-2 B-tree */
H5E_BEGIN_TRY
{
ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL);
@@ -4942,7 +4942,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (idx.key != ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 6))
TEST_ERROR
- /* Attempt to find non-existant record in level-2 B-tree */
+ /* Attempt to find non-existent record in level-2 B-tree */
/* (Should not be found, but not fail) */
find.key = INSERT_SPLIT_ROOT_NREC_REC * 42;
find.val = (hsize_t)-1;
@@ -4954,7 +4954,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (found)
TEST_ERROR
- /* Attempt to find existant record in root of level-2 B-tree */
+ /* Attempt to find existent record in root of level-2 B-tree */
find.key = 1345;
find.val = (hsize_t)-1;
found = FALSE;
@@ -4970,7 +4970,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
- /* Attempt to find existant record in internal node of level-2 B-tree */
+ /* Attempt to find existent record in internal node of level-2 B-tree */
find.key = 513;
find.val = (hsize_t)-1;
found = FALSE;
@@ -4986,7 +4986,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
- /* Attempt to find existant record in leaf of level-2 B-tree */
+ /* Attempt to find existent record in leaf of level-2 B-tree */
find.key = 555;
find.val = (hsize_t)-1;
found = FALSE;
@@ -5002,7 +5002,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
- /* Attempt to index non-existant record in level-2 B-tree */
+ /* Attempt to index non-existent record in level-2 B-tree */
H5E_BEGIN_TRY
{
ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL);
@@ -5188,7 +5188,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
if (iter.key != INSERT_MANY_REC)
TEST_ERROR
- /* Attempt to find non-existant record in level-4 B-tree */
+ /* Attempt to find non-existent record in level-4 B-tree */
/* (Should not be found, but not fail) */
find.key = INSERT_MANY_REC * 2;
find.val = (hsize_t)-1;
@@ -5206,7 +5206,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
find.key = (hsize_t)(HDrandom() % INSERT_MANY_REC);
find.val = (hsize_t)-1;
- /* Attempt to find existant record in level-4 B-tree */
+ /* Attempt to find existent record in level-4 B-tree */
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
FAIL_STACK_ERROR
@@ -5216,7 +5216,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
} /* end for */
- /* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */
+ /* Attempt to index non-existent record in level-4 B-tree, in increasing & decreasing order */
H5E_BEGIN_TRY
{
ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL);
@@ -5245,7 +5245,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- /* Attempt to find existant record in level-4 B-tree */
+ /* Attempt to find existent record in level-4 B-tree */
/* (in increasing order) */
if (H5B2_index(bt2, H5_ITER_INC, idx, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
@@ -5258,7 +5258,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- /* Attempt to find existant record in level-4 B-tree */
+ /* Attempt to find existent record in level-4 B-tree */
/* (in decreasing order) */
if (H5B2_index(bt2, H5_ITER_DEC, idx, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
@@ -5377,7 +5377,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
PASSED();
- TESTING("B-tree remove: non-existant record from 1 record B-tree");
+ TESTING("B-tree remove: non-existent record from 1 record B-tree");
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
@@ -5404,7 +5404,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
if (!H5F_addr_defined(root_addr))
TEST_ERROR
- /* Attempt to remove a non-existant record from a B-tree with 1 record */
+ /* Attempt to remove a non-existent record from a B-tree with 1 record */
record = 0;
H5E_BEGIN_TRY
{
@@ -5418,7 +5418,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
PASSED();
/* Attempt to remove a record from a B-tree with 1 record */
- TESTING("B-tree remove: existant record from 1 record B-tree");
+ TESTING("B-tree remove: existent record from 1 record B-tree");
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
@@ -5482,8 +5482,8 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
PASSED();
- /* Attempt to remove a non-existant record from a level-0 B-tree with mult. record */
- TESTING("B-tree remove: non-existant record from level-0 B-tree");
+ /* Attempt to remove a non-existent record from a level-0 B-tree with mult. record */
+ TESTING("B-tree remove: non-existent record from level-0 B-tree");
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
@@ -5502,7 +5502,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
PASSED();
/* Attempt to remove a record from a level-0 B-tree with mult. record */
- TESTING("B-tree remove: mult. existant records from level-0 B-tree");
+ TESTING("B-tree remove: mult. existent records from level-0 B-tree");
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
@@ -5660,7 +5660,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, const bt
herr_t ret; /* Generic error return value */
/* B-tree record removal tests */
- TESTING("B-tree remove: non-existant record from level-1 B-tree");
+ TESTING("B-tree remove: non-existent record from level-1 B-tree");
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
@@ -5693,7 +5693,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, const bt
if (!H5F_addr_defined(root_addr))
TEST_ERROR
- /* Attempt to remove a non-existant record from a B-tree with 1 record */
+ /* Attempt to remove a non-existent record from a B-tree with 1 record */
record = (INSERT_SPLIT_ROOT_NREC * 2) + 1;
H5E_BEGIN_TRY
{
@@ -8849,8 +8849,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
/* Check for VFD which stores data in multiple files */
- single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
- HDstrcmp(env_h5_drvr, "family") != 0);
+ single_file_vfd = !h5_driver_uses_multiple_files(env_h5_drvr, H5_EXCLUDE_NON_MULTIPART_DRIVERS);
if (single_file_vfd) {
/* Make a copy of the file in memory, in order to speed up deletion testing */
@@ -9749,7 +9748,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
/*
* Test modifying records
*/
- TESTING("B-tree modify: attempt to modify non-existant record");
+ TESTING("B-tree modify: attempt to modify non-existent record");
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
@@ -9772,7 +9771,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
if (bt2_stat.depth != 2)
TEST_ERROR
- /* Attempt to modify a non-existant record */
+ /* Attempt to modify a non-existent record */
record = 3;
modify = 4;
H5E_BEGIN_TRY
@@ -10127,7 +10126,7 @@ main(void)
const char * envval = NULL;
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
- envval = HDgetenv("HDF5_DRIVER");
+ envval = HDgetenv(HDF5_DRIVER);
if (envval == NULL)
envval = "nomatch";
@@ -10135,6 +10134,11 @@ main(void)
h5_reset();
fapl = h5_fileaccess();
ExpressMode = GetTestExpress();
+
+ /* For the Direct I/O driver, skip intensive tests due to poor performance */
+ if (!HDstrcmp(envval, "direct"))
+ ExpressMode = 2;
+
if (ExpressMode > 1)
HDprintf("***Express test mode on. Some tests may be skipped\n");
diff --git a/test/cache.c b/test/cache.c
index 6989564..e6a2ac8 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -2789,8 +2789,8 @@ write_permitted_check(int
* 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
+ * pinned entry functionality, but I through in explicit
+ * tests for other functionality that is tested implicitly
* elsewhere.
*
* Return: void
@@ -2908,7 +2908,7 @@ check_insert_entry(unsigned paged)
}
}
- /* Thats all we can get from H5C_get_entry_status().
+ /* That's all we can get from H5C_get_entry_status().
* Now start looking at the cache data structures directly.
*/
@@ -5146,7 +5146,7 @@ check_flush_cache__flush_ops(H5F_t *file_ptr)
*
* 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
+ * requirement 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.
*/
@@ -5238,7 +5238,7 @@ check_flush_cache__flush_ops(H5F_t *file_ptr)
*
* 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
+ * requirement 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.
*/
@@ -9603,7 +9603,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t *file_ptr)
*
* (VET, 9) Y 10 KB N N - dirty (VET, 8)
*
- * Recall that in this test bed, flush operations are excuted the
+ * Recall that in this test bed, flush operations are executed the
* first time the associated entry is flushed, and are then
* deleted.
*/
@@ -10156,7 +10156,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t *file_ptr)
* 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
+ * calls H5C_unprotect(VET, 8), which marks (VET, 8) as dirty and
* unprotected, and places it at the head of the LRU.
*
* (VET, 0) is the next item on the LRU -- it is clean and is therefore
@@ -10555,7 +10555,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t *file_ptr)
* Added tests for pinned entries.
*
* JRM -- 5/17/06
- * Complete reqrite of pinned entry tests to accomodate
+ * Complete reqrite of pinned entry tests to accommodate
* the new H5C_mark_entry_dirty() call.
*
*-------------------------------------------------------------------------
@@ -12980,7 +12980,7 @@ check_expunge_entry(unsigned paged)
* Function: check_multiple_read_protect()
*
* Purpose: Verify that multiple, simultaneous read protects of a
- * single entry perform as expectd.
+ * single entry perform as expected.
*
* Return: void
*
@@ -13326,7 +13326,7 @@ check_multiple_read_protect(unsigned paged)
if (pass && (entry_ptr->header.is_pinned)) {
pass = FALSE;
- failure_mssg = "enty (0,4) still pinned.\n";
+ failure_mssg = "entry (0,4) still pinned.\n";
}
unprotect_entry(file_ptr, 0, 4, /* (0,4) unprotect */
@@ -15529,7 +15529,7 @@ check_destroy_protected_err(unsigned paged)
* Function: check_duplicate_insert_err()
*
* Purpose: Verify that an attempt to insert and entry that is
- * alread in the cache will generate an error.
+ * already in the cache will generate an error.
*
* Return: void
*
@@ -18085,7 +18085,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if (show_progress)
HDfprintf(stderr, "check point %d\n", checkpoint++);
- /* eigth epoch -- force the hit rate to 100% again -- should be steady
+ /* eighth epoch -- force the hit rate to 100% again -- should be steady
* state.
*/
if (pass) {
@@ -18181,7 +18181,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if (show_progress)
HDfprintf(stderr, "check point %d\n", checkpoint++);
- if (pass) { /* twelth epoch -- at minimum size so no more ageouts */
+ if (pass) { /* twelfth epoch -- at minimum size so no more ageouts */
rpt_fcn_called = FALSE;
i = 0;
while (pass && (i < 1000)) {
@@ -18462,7 +18462,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if (show_progress)
HDfprintf(stderr, "check point %d\n", checkpoint++);
- /* eigth epoch -- still 100% hit rate
+ /* eighth epoch -- still 100% hit rate
*/
if (pass) {
@@ -18565,7 +18565,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if (show_progress)
HDfprintf(stderr, "check point %d\n", checkpoint++);
- /* twelth epoch -- force the hit rate to 100% again -- should be steady
+ /* twelfth epoch -- force the hit rate to 100% again -- should be steady
* state.
*/
if (pass) {
@@ -18941,7 +18941,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if (show_progress)
HDfprintf(stderr, "check point %d\n", checkpoint++);
- /* eigth epoch -- force the hit rate to 100% again -- should be steady
+ /* eighth epoch -- force the hit rate to 100% again -- should be steady
* state.
*/
if (pass) {
@@ -19041,7 +19041,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if (show_progress)
HDfprintf(stderr, "check point %d\n", checkpoint++);
- if (pass) { /* twelth epoch -- at minimum size so no more ageouts */
+ if (pass) { /* twelfth epoch -- at minimum size so no more ageouts */
rpt_fcn_called = FALSE;
i = 0;
@@ -19692,7 +19692,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if (show_progress)
HDfprintf(stderr, "check point %d\n", checkpoint++);
- /* twelth epoch -- hit rate 1.0 -- decrease as before.
+ /* twelfth epoch -- hit rate 1.0 -- decrease as before.
*/
if (pass) {
@@ -20705,7 +20705,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if (show_progress)
HDfprintf(stderr, "check point %d\n", checkpoint++);
- /* protect and unprotect two more large entries -- shouldnt trigger a
+ /* protect and unprotect two more large entries -- shouldn't trigger a
* flash cache size increase.
*/
if (pass) {
@@ -23265,7 +23265,7 @@ check_auto_cache_resize_disable(unsigned paged)
* mode (add space), which is triggered whenever the size of a newly
* loaded or inserted entry, or the delta between old and new entry
* sizes exceeds some fraction of the current maximum cache size, and
- * the cache doesn't have enough free space to accomodate the new/
+ * the cache doesn't have enough free space to accommodate the new/
* resize entry without performing evictions. The range of permissible
* values for the flash_threshold (0.1 to 1.0 as of this writing), and
* for the flash_multiple (0.1 to 10.0) do not permit the facility to
@@ -23274,7 +23274,7 @@ check_auto_cache_resize_disable(unsigned paged)
* current max_cache_size equal to max_size.
*
* We have already tested the latter in check_auto_cache_resize(), so
- * we need only thest the former here. Do this by disabling flash
+ * we need only test the former here. Do this by disabling flash
* cache size increments via the flash_incr_mode, and then creating
* situations that would trigger flash cache size increases were that
* code enabled.
@@ -26347,7 +26347,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
/*-------------------------------------------------------------------------
* Function: check_auto_cache_resize_aux_fcns()
*
- * Purpose: Verify that the auxilary functions associated with
+ * Purpose: Verify that the auxiliary functions associated with
* the automatic cache resize capability are operating
* correctly. These functions are:
*
@@ -26424,13 +26424,13 @@ check_auto_cache_resize_aux_fcns(unsigned paged)
};
if (paged)
- TESTING("automatic cache resize auxilary functions (paged aggregation)")
+ TESTING("automatic cache resize auxiliary functions (paged aggregation)")
else
- TESTING("automatic cache resize auxilary functions")
+ TESTING("automatic cache resize auxiliary functions")
pass = TRUE;
- /* allocate a cache, and then test the various auxilary functions.
+ /* allocate a cache, and then test the various auxiliary functions.
*/
if (pass) {
@@ -27077,7 +27077,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
if (file_ptr == NULL) {
pass = FALSE;
- failure_mssg = "bad return from cache intialization.\n";
+ failure_mssg = "bad return from cache initialization.\n";
}
else
cache_ptr = file_ptr->shared->cache;
@@ -27296,7 +27296,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
H5C__DIRTIED_FLAG); /* unsigned int flags */
}
- /* Expected staus is that after each insertion, the entry
+ /* Expected status is that after each insertion, the entry
* inserted 26 insertions ago has been flushed, and the
* entry currently getting inserted is now in the cache and
* dirty.
@@ -29701,7 +29701,7 @@ check_flush_deps_err(unsigned paged)
result =
H5C_destroy_flush_dependency(&((entries[entry_type])[0]), &((entries[entry_type])[1]));
if (result != FAIL)
- CACHE_ERROR("Destroying [non-existant] dependency when parent isn't protected")
+ CACHE_ERROR("Destroying [non-existent] dependency when parent isn't protected")
break;
/* Verify that parent entry has flush dependency */
@@ -33057,7 +33057,7 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
if (file_ptr == NULL) {
pass = FALSE;
- failure_mssg = "bad return from cache intialization.\n";
+ failure_mssg = "bad return from cache initialization.\n";
}
else
cache_ptr = file_ptr->shared->cache;
@@ -33567,7 +33567,7 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
* an entry that is no longer in the cache, and which may have
* been deleted.
*
- * This function contans tests for correct handling on this
+ * This function contains tests for correct handling on this
* situation.
*
* Do nothing if pass is FALSE on entry.
@@ -33798,7 +33798,7 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t *file_ptr)
*
* (HET, 3) Y 16 KB Y N - -
*
- * Recall that in this test bed, flush operations are excuted the
+ * Recall that in this test bed, flush operations are executed the
* first time the associated entry is flushed, and are then
* deleted.
*/
@@ -34048,7 +34048,7 @@ cedds__H5C_make_space_in_cache(H5F_t *file_ptr)
*
* (HET, 3) Y 16 KB N N - -
*
- * Recall that in this test bed, flush operations are excuted the
+ * Recall that in this test bed, flush operations are executed the
* first time the associated entry is flushed, and are then
* deleted.
*/
@@ -34463,7 +34463,7 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *file_ptr)
*
* (MET, 1-31) Y 64 KB N N - -
*
- * Recall that in this test bed, flush operations are excuted the
+ * Recall that in this test bed, flush operations are executed the
* first time the associated entry is flushed, and are then
* deleted.
*/
@@ -35888,6 +35888,11 @@ main(void)
HDprintf(" express_test = %d\n", express_test);
HDprintf("=========================================\n");
+ if (!h5_using_default_driver(NULL)) {
+ HDputs(" -- SKIPPED for incompatible VFD --");
+ HDexit(EXIT_SUCCESS);
+ }
+
if (create_entry_arrays() < 0) {
HDprintf("ERROR: Unable to create entries arrays. Aborting.\n");
diff --git a/test/cache_api.c b/test/cache_api.c
index 412888e..6e897ec 100644
--- a/test/cache_api.c
+++ b/test/cache_api.c
@@ -306,10 +306,10 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id)
pass = FALSE;
failure_mssg = "H5Fclose() failed.\n";
}
- else if (HDremove(filename) < 0) {
+ else if (H5Fdelete(filename, H5P_DEFAULT) < 0) {
pass = FALSE;
- failure_mssg = "HDremove() failed.\n";
+ failure_mssg = "H5Fdelete() failed.\n";
}
}
@@ -442,28 +442,28 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id)
}
}
- /* close the fapl used to create the file */
+ /* close the file and delete it */
if (pass) {
- if (H5Pclose(fapl_id) < 0) {
+ if (H5Fclose(file_id) < 0) {
pass = FALSE;
- failure_mssg = "H5Pclose() failed.\n";
+ failure_mssg = "H5Fclose() failed.\n";
+ }
+ else if (H5Fdelete(filename, fapl_id) < 0) {
+
+ pass = FALSE;
+ failure_mssg = "H5Fdelete() failed.\n";
}
}
- /* close the file and delete it */
+ /* close the fapl used to create the file */
if (pass) {
- if (H5Fclose(file_id) < 0) {
-
- pass = FALSE;
- failure_mssg = "H5Fclose() failed.\n";
- }
- else if (HDremove(filename) < 0) {
+ if (H5Pclose(fapl_id) < 0) {
pass = FALSE;
- failure_mssg = "HDremove() failed.\n";
+ failure_mssg = "H5Pclose() failed.\n";
}
}
@@ -662,7 +662,7 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
* configured as per the default both by looking at its internal
* configuration, and via the H5Fget_mdc_config() call.
*
- * Then set serveral different configurations, and verify that
+ * Then set several different configurations, and verify that
* they took as per above.
*/
@@ -803,10 +803,10 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
pass = FALSE;
failure_mssg = "H5Fclose() failed.\n";
}
- else if (HDremove(filename) < 0) {
+ else if (H5Fdelete(filename, H5P_DEFAULT) < 0) {
pass = FALSE;
- failure_mssg = "HDremove() failed.\n";
+ failure_mssg = "H5Fdelete() failed.\n";
}
}
@@ -1054,7 +1054,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
}
/* set the dataset creation plist to specify that the raw data is
- * to be partioned into 10X10 element chunks.
+ * to be partitioned into 10X10 element chunks.
*/
if (pass) {
@@ -1082,7 +1082,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
/* create the dataset */
if (pass) {
- HDsprintf(dset_name, "/dset%03d", i);
+ HDsnprintf(dset_name, sizeof(dset_name), "/dset%03d", i);
dataset_ids[i] = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE, dataspace_id, H5P_DEFAULT,
properties, H5P_DEFAULT);
@@ -1445,10 +1445,10 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
pass = FALSE;
failure_mssg = "H5Fclose() failed.\n";
}
- else if (HDremove(filename) < 0) {
+ else if (H5Fdelete(filename, H5P_DEFAULT) < 0) {
pass = FALSE;
- failure_mssg = "HDremove() failed.\n";
+ failure_mssg = "H5Fdelete() failed.\n";
}
}
@@ -1885,7 +1885,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
pass = TRUE;
- /* Create a file for test purposes, and veify that its metadata cache
+ /* Create a file for test purposes, and verify that its metadata cache
* set to the default MDC configuration.
*/
@@ -2170,10 +2170,10 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
pass = FALSE;
failure_mssg = "H5Fclose() failed.\n";
}
- else if (HDremove(filename) < 0) {
+ else if (H5Fdelete(filename, H5P_DEFAULT) < 0) {
pass = FALSE;
- failure_mssg = "HDremove() failed.\n";
+ failure_mssg = "H5Fdelete() failed.\n";
}
}
@@ -2254,12 +2254,17 @@ main(void)
} /* end if */
/* Test with paged aggregation enabled or not */
- /* The "my_fcpl" passed to each test has the paged or non-paged strategy set up accordinly */
+ /* The "my_fcpl" passed to each test has the paged or non-paged strategy set up accordingly */
for (paged = FALSE; paged <= TRUE; paged++) {
hid_t my_fcpl = fcpl_id;
- if (paged)
- my_fcpl = fcpl2_id;
+ if (paged) {
+ /* Only run paged aggregation tests with sec2/default driver */
+ if (!h5_using_default_driver(NULL))
+ continue;
+ else
+ my_fcpl = fcpl2_id;
+ }
if (!check_fapl_mdc_api_calls(paged, my_fcpl))
nerrs += 1;
diff --git a/test/cache_common.c b/test/cache_common.c
index 5fcbed5..8614605 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -1529,7 +1529,7 @@ add_flush_op(int target_type, int target_idx, int op_code, int type, int idx, hb
* 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
+ * Given the types and indices 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
@@ -1768,7 +1768,7 @@ execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, struct flush_o
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
+ * case in which an entry is removed from the cache 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
@@ -2313,7 +2313,7 @@ verify_clean(void)
* Function: verify_entry_status
*
* Purpose: Verify that a list of entries have the expected status.
- * If any discrepencies are found, set the failure message
+ * If any discrepancies are found, set the failure message
* and set pass to FALSE.
*
* Do nothing if pass is FALSE on entry.
@@ -2329,8 +2329,8 @@ verify_clean(void)
void
verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_entry_status expected[])
{
- static char msg[256];
- int i;
+ char msg[256];
+ int i;
i = 0;
while ((pass) && (i < num_entries)) {
@@ -2342,14 +2342,15 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
if ((!expected[i].in_cache) && ((expected[i].is_protected) || (expected[i].is_pinned))) {
pass = FALSE;
- HDsprintf(msg, "%d: Contradictory data in expected[%d].\n", tag, i);
+ HDsnprintf(msg, sizeof(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;
- HDsprintf(msg, "%d: expected[%d] specs non-expunged, dirty, non-resident.\n", tag, i);
+ HDsnprintf(msg, sizeof(msg), "%d: expected[%d] specs non-expunged, dirty, non-resident.\n", tag,
+ i);
failure_mssg = msg;
}
@@ -2360,9 +2361,9 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
if (in_cache != expected[i].in_cache) {
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);
+ HDsnprintf(msg, sizeof(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;
}
}
@@ -2372,9 +2373,9 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
if (entry_ptr->size != expected[i].size) {
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);
+ HDsnprintf(msg, sizeof(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;
}
}
@@ -2384,9 +2385,9 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
if (entry_ptr->header.size != expected[i].size) {
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);
+ HDsnprintf(msg, sizeof(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;
}
}
@@ -2396,9 +2397,9 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
if (entry_ptr->at_main_addr != expected[i].at_main_addr) {
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);
+ HDsnprintf(msg, sizeof(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;
}
}
@@ -2408,9 +2409,9 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
if (entry_ptr->is_dirty != expected[i].is_dirty) {
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);
+ HDsnprintf(msg, sizeof(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;
}
}
@@ -2420,9 +2421,9 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
if (entry_ptr->header.is_dirty != expected[i].is_dirty) {
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);
+ HDsnprintf(msg, sizeof(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;
}
}
@@ -2432,9 +2433,9 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
if (entry_ptr->is_protected != expected[i].is_protected) {
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);
+ HDsnprintf(msg, sizeof(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;
}
}
@@ -2444,9 +2445,10 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
if (entry_ptr->header.is_protected != expected[i].is_protected) {
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);
+ HDsnprintf(msg, sizeof(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;
}
}
@@ -2456,9 +2458,9 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
if (entry_ptr->is_pinned != expected[i].is_pinned) {
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);
+ HDsnprintf(msg, sizeof(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;
}
}
@@ -2468,9 +2470,9 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
if (entry_ptr->is_corked != expected[i].is_corked) {
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);
+ HDsnprintf(msg, sizeof(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;
}
}
@@ -2480,9 +2482,9 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
if (entry_ptr->header.is_pinned != expected[i].is_pinned) {
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);
+ HDsnprintf(msg, sizeof(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;
}
}
@@ -2494,11 +2496,12 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
(entry_ptr->destroyed != expected[i].destroyed)) {
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));
+ HDsnprintf(msg, sizeof(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));
failure_mssg = msg;
}
}
@@ -2509,18 +2512,19 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
if (pass) {
if (entry_ptr->flush_dep_npar != expected[i].flush_dep_npar) {
pass = FALSE;
- HDsprintf(msg, "%d entry (%d, %d) flush_dep_npar actual/expected = %u/%u.\n", tag,
- expected[i].entry_type, expected[i].entry_index, entry_ptr->flush_dep_npar,
- expected[i].flush_dep_npar);
+ HDsnprintf(msg, sizeof(msg), "%d entry (%d, %d) flush_dep_npar actual/expected = %u/%u.\n",
+ tag, expected[i].entry_type, expected[i].entry_index, entry_ptr->flush_dep_npar,
+ expected[i].flush_dep_npar);
failure_mssg = msg;
} /* end if */
} /* end if */
if ((pass) && (in_cache)) {
if (entry_ptr->header.flush_dep_nparents != expected[i].flush_dep_npar) {
pass = FALSE;
- HDsprintf(msg, "%d entry (%d, %d) header flush_dep_nparents actual/expected = %u/%u.\n", tag,
- expected[i].entry_type, expected[i].entry_index,
- entry_ptr->header.flush_dep_nparents, expected[i].flush_dep_npar);
+ HDsnprintf(msg, sizeof(msg),
+ "%d entry (%d, %d) header flush_dep_nparents actual/expected = %u/%u.\n", tag,
+ expected[i].entry_type, expected[i].entry_index,
+ entry_ptr->header.flush_dep_nparents, expected[i].flush_dep_npar);
failure_mssg = msg;
} /* end if */
} /* end if */
@@ -2531,9 +2535,10 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
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;
- HDsprintf(msg, "%d entry (%d, %d) flush_dep_par_type[%u] actual/expected = %d/%d.\n", tag,
- expected[i].entry_type, expected[i].entry_index, u,
- entry_ptr->flush_dep_par_type[u], expected[i].flush_dep_par_type[u]);
+ HDsnprintf(msg, sizeof(msg),
+ "%d entry (%d, %d) flush_dep_par_type[%u] actual/expected = %d/%d.\n", tag,
+ expected[i].entry_type, expected[i].entry_index, u,
+ entry_ptr->flush_dep_par_type[u], expected[i].flush_dep_par_type[u]);
failure_mssg = msg;
} /* end if */
} /* end for */
@@ -2542,9 +2547,10 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
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;
- HDsprintf(msg, "%d entry (%d, %d) flush_dep_par_idx[%u] actual/expected = %d/%d.\n", tag,
- expected[i].entry_type, expected[i].entry_index, u,
- entry_ptr->flush_dep_par_idx[u], expected[i].flush_dep_par_idx[u]);
+ HDsnprintf(msg, sizeof(msg),
+ "%d entry (%d, %d) flush_dep_par_idx[%u] actual/expected = %d/%d.\n", tag,
+ expected[i].entry_type, expected[i].entry_index, u,
+ entry_ptr->flush_dep_par_idx[u], expected[i].flush_dep_par_idx[u]);
failure_mssg = msg;
} /* end if */
} /* end for */
@@ -2554,37 +2560,39 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
if (pass) {
if (entry_ptr->flush_dep_nchd != expected[i].flush_dep_nchd) {
pass = FALSE;
- HDsprintf(msg, "%d entry (%d, %d) flush_dep_nchd actual/expected = %u/%u.\n", tag,
- expected[i].entry_type, expected[i].entry_index, entry_ptr->flush_dep_nchd,
- expected[i].flush_dep_nchd);
+ HDsnprintf(msg, sizeof(msg), "%d entry (%d, %d) flush_dep_nchd actual/expected = %u/%u.\n",
+ tag, expected[i].entry_type, expected[i].entry_index, entry_ptr->flush_dep_nchd,
+ expected[i].flush_dep_nchd);
failure_mssg = msg;
} /* end if */
} /* end if */
if ((pass) && (in_cache)) {
if (entry_ptr->header.flush_dep_nchildren != expected[i].flush_dep_nchd) {
pass = FALSE;
- HDsprintf(msg, "%d entry (%d, %d) header flush_dep_nchildren actual/expected = %u/%u.\n", tag,
- expected[i].entry_type, expected[i].entry_index,
- entry_ptr->header.flush_dep_nchildren, expected[i].flush_dep_nchd);
+ HDsnprintf(msg, sizeof(msg),
+ "%d entry (%d, %d) header flush_dep_nchildren actual/expected = %u/%u.\n", tag,
+ expected[i].entry_type, expected[i].entry_index,
+ entry_ptr->header.flush_dep_nchildren, expected[i].flush_dep_nchd);
failure_mssg = msg;
} /* end if */
} /* end if */
if (pass) {
if (entry_ptr->flush_dep_ndirty_chd != expected[i].flush_dep_ndirty_chd) {
pass = FALSE;
- HDsprintf(msg, "%d entry (%d, %d) flush_dep_ndirty_chd actual/expected = %u/%u.\n", tag,
- expected[i].entry_type, expected[i].entry_index, entry_ptr->flush_dep_ndirty_chd,
- expected[i].flush_dep_ndirty_chd);
+ HDsnprintf(msg, sizeof(msg),
+ "%d entry (%d, %d) flush_dep_ndirty_chd actual/expected = %u/%u.\n", tag,
+ expected[i].entry_type, expected[i].entry_index, entry_ptr->flush_dep_ndirty_chd,
+ expected[i].flush_dep_ndirty_chd);
failure_mssg = msg;
} /* end if */
} /* end if */
if ((pass) && (in_cache)) {
if (entry_ptr->header.flush_dep_ndirty_children != expected[i].flush_dep_ndirty_chd) {
pass = FALSE;
- HDsprintf(msg,
- "%d entry (%d, %d) header flush_dep_ndirty_children actual/expected = %u/%u.\n",
- tag, expected[i].entry_type, expected[i].entry_index,
- entry_ptr->header.flush_dep_ndirty_children, expected[i].flush_dep_ndirty_chd);
+ HDsnprintf(msg, sizeof(msg),
+ "%d entry (%d, %d) header flush_dep_ndirty_children actual/expected = %u/%u.\n",
+ tag, expected[i].entry_type, expected[i].entry_index,
+ entry_ptr->header.flush_dep_ndirty_children, expected[i].flush_dep_ndirty_chd);
failure_mssg = msg;
} /* end if */
} /* end if */
@@ -2593,9 +2601,9 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
if (pass) {
if (expected[i].flush_order >= 0 && entry_ptr->flush_order != (unsigned)expected[i].flush_order) {
pass = FALSE;
- HDsprintf(msg, "%d entry (%d, %d) flush_order actual/expected = %u/%d.\n", tag,
- expected[i].entry_type, expected[i].entry_index, entry_ptr->flush_order,
- expected[i].flush_order);
+ HDsnprintf(msg, sizeof(msg), "%d entry (%d, %d) flush_order actual/expected = %u/%d.\n", tag,
+ expected[i].entry_type, expected[i].entry_index, entry_ptr->flush_order,
+ expected[i].flush_order);
failure_mssg = msg;
} /* end if */
} /* end if */
@@ -3825,7 +3833,7 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
HDassert((!cache_ptr->slist_enabled) ||
(cache_ptr->slist_size == cache_ptr->dirty_index_size));
} /* end if */
- } /* end elsef */
+ } /* end elseif */
if (verbose)
HDfprintf(stdout, "\n");
@@ -4504,7 +4512,7 @@ col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
int mile_stone = 1;
int32_t type;
int32_t idx;
- int32_t local_max_index[NUMBER_OF_ENTRY_TYPES];
+ int32_t local_max_index[NUMBER_OF_ENTRY_TYPES] = {0};
if (verbose)
HDfprintf(stdout, "%s: entering.\n", __func__);
@@ -5006,7 +5014,7 @@ check_and_validate_cache_hit_rate(hid_t file_id, double *hit_rate_ptr, hbool_t d
}
else {
- expected_hit_rate = 0.0F;
+ expected_hit_rate = 0.0;
}
result = H5Fget_mdc_hit_rate(file_id, &hit_rate);
@@ -5233,7 +5241,7 @@ resize_configs_are_equal(const H5C_auto_size_ctl_t *a, const H5C_auto_size_ctl_t
* has both internal and external configuration matching
* *config_ptr.
*
- * Do nothin on success. On failure, set pass to FALSE, and
+ * Do nothing 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.
*
diff --git a/test/cache_common.h b/test/cache_common.h
index 8f4e776..3a4be95 100644
--- a/test/cache_common.h
+++ b/test/cache_common.h
@@ -347,7 +347,7 @@ typedef struct test_entry_t {
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
+ int pin_idx[MAX_PINS]; /* array of the indices of
* entries pinned by this entry.
*/
int num_flush_ops; /* integer field containing the
@@ -393,7 +393,7 @@ 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.) */
+ flush_dep_ndirty_chd; /* Number of dirty flush dependency children (including grandchildren, etc.) */
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 */
diff --git a/test/cache_image.c b/test/cache_image.c
index f63f04a..0d0f27c 100644
--- a/test/cache_image.c
+++ b/test/cache_image.c
@@ -138,7 +138,7 @@ create_datasets(hid_t file_id, int min_dset, int max_dset)
}
/* set the dataset creation plist to specify that the raw data is
- * to be partioned into 10X10 element chunks.
+ * to be partitioned into 10X10 element chunks.
*/
if (pass) {
@@ -166,7 +166,7 @@ create_datasets(hid_t file_id, int min_dset, int max_dset)
/* create the dataset */
if (pass) {
- HDsprintf(dset_name, "/dset%03d", i);
+ HDsnprintf(dset_name, sizeof(dset_name), "/dset%03d", i);
dataset_ids[i] = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE, dataspace_id, H5P_DEFAULT,
properties, H5P_DEFAULT);
@@ -445,7 +445,7 @@ delete_datasets(hid_t file_id, int min_dset, int max_dset)
i = min_dset;
while ((pass) && (i <= max_dset)) {
- HDsprintf(dset_name, "/dset%03d", i);
+ HDsnprintf(dset_name, sizeof(dset_name), "/dset%03d", i);
if (H5Ldelete(file_id, dset_name, H5P_DEFAULT) < 0) {
@@ -472,7 +472,7 @@ delete_datasets(hid_t file_id, int min_dset, int max_dset)
* 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.
+ * vice versa.
*
* If mdci_sbem_expected is TRUE, also verify that the metadata
* cache has been advised of this.
@@ -546,7 +546,7 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, hbool_t read_onl
if (show_progress)
HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++);
- /* create a file access propertly list. */
+ /* create a file access property list. */
if (pass) {
fapl_id = h5_fileaccess();
@@ -881,7 +881,7 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file, const hbool_t set_mdci_fa
H5AC_cache_image_config_t cache_image_config = {H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION, TRUE, FALSE,
H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE};
- /* create a file access propertly list. */
+ /* create a file access property list. */
if (pass) {
fapl_id = h5_fileaccess();
@@ -1021,7 +1021,7 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset)
/* open the dataset */
if (pass) {
- HDsprintf(dset_name, "/dset%03d", i);
+ HDsnprintf(dset_name, sizeof(dset_name), "/dset%03d", i);
dataset_ids[i] = H5Dopen2(file_id, dset_name, H5P_DEFAULT);
if (dataset_ids[i] < 0) {
@@ -1507,7 +1507,7 @@ check_cache_image_ctl_flow_1(hbool_t single_file_vfd)
* 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 perform the following operations:
*
* 1) Create a HDF5 file with the cache image FAPL entry.
*
@@ -4626,7 +4626,7 @@ cache_image_smoke_check_5(hbool_t single_file_vfd)
/* 2) Create a process specific group. */
if (pass) {
- HDsprintf(process_group_name, "/process_%d", min_group);
+ HDsnprintf(process_group_name, sizeof(process_group_name), "/process_%d", min_group);
proc_gid = H5Gcreate2(file_id, process_group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@@ -4737,7 +4737,7 @@ cache_image_smoke_check_5(hbool_t single_file_vfd)
if (pass) {
max_group++;
- HDsprintf(process_group_name, "/process_%d", max_group);
+ HDsnprintf(process_group_name, sizeof(process_group_name), "/process_%d", max_group);
proc_gid = H5Gcreate2(file_id, process_group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@@ -4815,7 +4815,7 @@ cache_image_smoke_check_5(hbool_t single_file_vfd)
/* 11) Validate all the zoos. */
i = min_group;
while (pass && i <= max_group) {
- HDsprintf(process_group_name, "/process_%d", i);
+ HDsnprintf(process_group_name, sizeof(process_group_name), "/process_%d", i);
pass = validate_zoo(
file_id, process_group_name, &lastmsgtime,
(zoo_config_t){.proc_num = i++, .skip_varlen = false, .skip_compact = false, .msgival = {0, 0}});
@@ -4869,7 +4869,7 @@ cache_image_smoke_check_5(hbool_t single_file_vfd)
i = min_group;
while ((pass) && (i <= max_group)) {
- HDsprintf(process_group_name, "/process_%d", i);
+ HDsnprintf(process_group_name, sizeof(process_group_name), "/process_%d", i);
pass = validate_zoo(
file_id, process_group_name, &lastmsgtime,
(zoo_config_t){.proc_num = i++, .skip_varlen = false, .skip_compact = false, .msgival = {0, 0}});
@@ -4931,7 +4931,7 @@ cache_image_smoke_check_5(hbool_t single_file_vfd)
*/
i = min_group;
while ((pass) && (i <= max_group)) {
- HDsprintf(process_group_name, "/process_%d", i);
+ HDsnprintf(process_group_name, sizeof(process_group_name), "/process_%d", i);
pass = validate_zoo(
file_id, process_group_name, &lastmsgtime,
(zoo_config_t){.proc_num = i++, .skip_varlen = false, .skip_compact = false, .msgival = {0, 0}});
@@ -7020,7 +7020,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd)
* image.
*
* The objective of this test is to create a test file
- * with both non-empty self referential presistant
+ * with both non-empty self referential persistent
* 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
@@ -7858,7 +7858,7 @@ main(void)
int express_test;
/* Get the VFD to use */
- env_h5_drvr = HDgetenv("HDF5_DRIVER");
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
if (env_h5_drvr == NULL)
env_h5_drvr = "nomatch";
@@ -7872,8 +7872,7 @@ main(void)
HDprintf("=========================================\n");
/* Check for VFD which stores data in multiple files */
- single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
- HDstrcmp(env_h5_drvr, "family") != 0);
+ single_file_vfd = !h5_driver_uses_multiple_files(env_h5_drvr, H5_EXCLUDE_NON_MULTIPART_DRIVERS);
nerrs += check_cache_image_ctl_flow_1(single_file_vfd);
nerrs += check_cache_image_ctl_flow_2(single_file_vfd);
diff --git a/test/cache_tagging.c b/test/cache_tagging.c
index 06de174..a335193 100644
--- a/test/cache_tagging.c
+++ b/test/cache_tagging.c
@@ -443,7 +443,7 @@ 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 */
+ int verbose = FALSE; /* verbose test output */
#endif /* NDEBUG */
hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
@@ -547,7 +547,7 @@ 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 */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
hid_t fapl = -1; /* File access prop list */
haddr_t root_tag; /* Root Group Tag */
@@ -677,7 +677,7 @@ check_group_creation_tags(void)
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = HADDR_UNDEF; /* Root Group Tag */
@@ -800,7 +800,7 @@ check_multi_group_creation_tags(void)
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
char gname[16]; /* group name buffer */
int i = 0; /* iterator */
@@ -952,7 +952,7 @@ check_link_iteration_tags(void)
hid_t sid = -1; /* Group Identifier */
hid_t did = -1; /* Group Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
int i = 0; /* iterator */
haddr_t root_tag = 0; /* Root Group Tag Value */
@@ -1094,7 +1094,7 @@ check_dense_attribute_tags(void)
hid_t did = -1; /* Group Identifier */
hid_t dcpl = -1; /* Group Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
int i = 0; /* iterator */
hid_t fapl = -1; /* File access property list */
@@ -1455,7 +1455,7 @@ check_attribute_creation_tags(hid_t fcpl, int type)
hid_t gid = -1; /* Group Identifier */
hid_t sid = -1; /* Dataspace Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0; /* Root group tag */
@@ -1620,7 +1620,7 @@ check_attribute_open_tags(hid_t fcpl, int type)
hid_t gid = -1; /* Group Identifier */
hid_t sid = -1; /* Dataspace Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
@@ -1787,7 +1787,7 @@ check_attribute_rename_tags(hid_t fcpl, int type)
hid_t aid = -1; /* Attribute Identifier */
hid_t sid = -1; /* Dataset Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
int * data = NULL; /* data buffer */
int i, j, k = 0; /* iterators */
@@ -2000,7 +2000,7 @@ check_attribute_delete_tags(hid_t fcpl, int type)
hid_t aid = -1; /* Attribute Identifier */
hid_t sid = -1; /* Dataset Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
int * data = NULL; /* data buffer */
int i, j, k = 0; /* iterators */
@@ -2191,7 +2191,7 @@ check_dataset_creation_tags(hid_t fcpl, int type)
hid_t did = -1; /* Dataset Identifier */
hid_t sid = -1; /* Dataspace Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1, 1}; /* chunk dimensions */
@@ -2351,7 +2351,7 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type)
hid_t did = -1; /* Dataset Identifier */
hid_t sid = -1; /* Dataspace Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1, 1}; /* chunk dimensions */
@@ -2517,7 +2517,7 @@ check_dataset_open_tags(void)
hid_t did = -1; /* Dataset Identifier */
hid_t sid = -1; /* Dataspace Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1, 1}; /* chunk dimensions */
@@ -2669,7 +2669,7 @@ check_dataset_write_tags(void)
hid_t did = -1; /* Dataset Identifier */
hid_t sid = -1; /* Dataspace Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1, 1}; /* chunk dimensions */
@@ -2836,7 +2836,7 @@ check_attribute_write_tags(hid_t fcpl, int type)
hid_t aid = -1; /* Attribute Identifier */
hid_t sid = -1; /* Dataset Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
int * data = NULL; /* data buffer */
int i, j, k = 0; /* iterators */
@@ -3022,7 +3022,7 @@ check_dataset_read_tags(void)
hid_t did = -1; /* Dataset Identifier */
hid_t sid = -1; /* Dataspace Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1, 1}; /* chunk dimensions */
@@ -3184,7 +3184,7 @@ check_dataset_size_retrieval(void)
hid_t did = -1; /* Dataset Identifier */
hid_t sid = -1; /* Dataspace Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1, 1}; /* chunk dimensions */
@@ -3348,7 +3348,7 @@ check_dataset_extend_tags(void)
hid_t did = -1; /* Dataset Identifier */
hid_t sid = -1; /* Dataspace Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1, 1}; /* chunk dimensions */
@@ -3795,7 +3795,7 @@ check_link_removal_tags(hid_t fcpl, int type)
hid_t sid = -1; /* Dataspace Identifier */
hid_t gid = -1; /* Dataspace Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1, 1}; /* chunk dimensions */
@@ -3984,7 +3984,7 @@ check_link_getname_tags(void)
hid_t sid = -1; /* Dataspace Identifier */
hid_t gid = -1; /* Dataspace Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1, 1}; /* chunk dimensions */
@@ -4161,7 +4161,7 @@ check_external_link_creation_tags(void)
hid_t fid2 = -1; /* File Identifier */
hid_t gid = -1; /* Dataspace Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
@@ -4288,7 +4288,7 @@ check_external_link_open_tags(void)
hid_t gid = -1; /* Dataspace Identifier */
hid_t xid = -1; /* Dataspace Identifier */
#ifndef NDEBUG
- int verbose = FALSE; /* verbose file outout */
+ int verbose = FALSE; /* verbose file output */
#endif /* NDEBUG */
H5O_native_info_t ninfo; /* Native object info struct */
hid_t fapl = -1; /* File access prop list */
@@ -4572,6 +4572,12 @@ main(void)
/* Open the HDF5 Library */
H5open();
+ /* Only run with sec2/default driver */
+ if (!h5_using_default_driver(NULL)) {
+ HDputs(" -- SKIPPED for incompatible VFD --");
+ HDexit(EXIT_SUCCESS);
+ }
+
/* ========== */
/* Test Setup */
/* ========== */
@@ -4579,7 +4585,7 @@ main(void)
/* Create a standard file creation property list */
fcpl_default = H5Pcreate(H5P_FILE_CREATE);
- /* Create an fcpl with shared messages and file space managment enabled */
+ /* Create an fcpl with shared messages and file space management enabled */
fcpl_shmesg_all = H5Pcreate(H5P_FILE_CREATE);
H5Pset_shared_mesg_nindexes(fcpl_shmesg_all, 1);
H5Pset_shared_mesg_index(fcpl_shmesg_all, 0, H5O_SHMESG_ALL_FLAG, 20);
diff --git a/test/chunk_info.c b/test/chunk_info.c
index a1c4160..2bec42d 100644
--- a/test/chunk_info.c
+++ b/test/chunk_info.c
@@ -291,7 +291,7 @@ index_type_str(H5D_chunk_index_t idx_type)
/*-------------------------------------------------------------------------
* Function: verify_selected_chunks (helper function)
*
- * Purpose: Reads the chunks within the boundery {start,end} and verify
+ * Purpose: Reads the chunks within the boundary {start,end} and verify
* the values against the populated data.
*
* Return: Success: SUCCEED
@@ -321,7 +321,7 @@ verify_selected_chunks(hid_t dset, hid_t plist, const hsize_t *start, const hsiz
for (jj = 0; jj < CHUNK_NY; jj++)
expected_buf[n][ii][jj] = (int)(ii * jj) + 1;
- /* Read each chunk within the boundery of {start,end} and verify the
+ /* Read each chunk within the boundary of {start,end} and verify the
values against the expected data */
chk_index = 0;
for (ii = start[0]; ii < end[0]; ii++)
@@ -421,7 +421,7 @@ verify_idx_nchunks(hid_t dset, hid_t dspace, H5D_chunk_index_t exp_idx_type, hsi
/* Ensure the correct chunk indexing scheme is used */
if (idx_type != exp_idx_type) {
char msg[256];
- HDsprintf(msg, "Should be using %s.\n", index_type_str(idx_type));
+ HDsnprintf(msg, sizeof(msg), "Should be using %s.\n", index_type_str(idx_type));
FAIL_PUTS_ERROR(msg);
}
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index 8777096..024b6c0 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -713,7 +713,7 @@ test_compound(char *filename, hid_t fapl)
/*
*######################################################################
* Step 12: Write an array into the middle third of the dataset
- * initializeing only members `b' and `d' to -1.
+ * initializing only members `b' and `d' to -1.
*/
TESTING("hyperslab part initialized write");
@@ -1766,7 +1766,7 @@ test_pack_ooo(void)
/* Insert the compound members in the random order previously generated */
for (i = 0; i < PACK_NMEMBS; i++) {
- HDsprintf(name, "%05d", i);
+ HDsnprintf(name, sizeof(name), "%05d", i);
if (i == sub_cmpd_order) {
if (H5Tinsert(cmpd, name, (size_t)(4 * order[i]), sub_cmpd) < 0)
PACK_OOO_ERROR
@@ -1799,7 +1799,7 @@ test_pack_ooo(void)
/* Insert the compound members in the random order previously generated */
for (i = 0; i < PACK_NMEMBS; i++) {
- HDsprintf(name, "%05d", i);
+ HDsnprintf(name, sizeof(name), "%05d", i);
if (i == sub_cmpd_order) {
if (H5Tinsert(cmpd, name, (size_t)(4 * order[i]), sub_cmpd) < 0)
PACK_OOO_ERROR
@@ -1834,7 +1834,7 @@ test_pack_ooo(void)
/* Insert the compound members in reverse order, with compound last */
for (i = 0; i < PACK_NMEMBS; i++) {
- HDsprintf(name, "%05d", i);
+ HDsnprintf(name, sizeof(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
@@ -1867,7 +1867,7 @@ test_pack_ooo(void)
/* Insert the compound members in reverse order, with compound last */
for (i = 0; i < PACK_NMEMBS; i++) {
- HDsprintf(name, "%05d", i);
+ HDsnprintf(name, sizeof(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
@@ -1902,7 +1902,7 @@ test_pack_ooo(void)
/* Insert the compound members in forward order, with compound first */
for (i = 0; i < PACK_NMEMBS; i++) {
- HDsprintf(name, "%05d", i);
+ HDsnprintf(name, sizeof(name), "%05d", i);
if (i == 0) {
if (H5Tinsert(cmpd, name, (size_t)(4 * i), sub_cmpd) < 0)
PACK_OOO_ERROR
@@ -1935,7 +1935,7 @@ test_pack_ooo(void)
/* Insert the compound members in forward order */
for (i = 0; i < PACK_NMEMBS; i++) {
- HDsprintf(name, "%05d", i);
+ HDsnprintf(name, sizeof(name), "%05d", i);
if (i == 0) {
if (H5Tinsert(cmpd, name, (size_t)(4 * i), sub_cmpd) < 0)
PACK_OOO_ERROR
diff --git a/test/cork.c b/test/cork.c
index 28c0604..b1f28c1 100644
--- a/test/cork.c
+++ b/test/cork.c
@@ -26,7 +26,11 @@
*/
#define H5C_FRIEND /*suppress error about including H5Cpkg */
#define H5C_TESTING /*suppress warning about H5C testing funcs*/
+#define H5FD_FRIEND /*suppress error about including H5FDpkg */
+#define H5FD_TESTING
+
#include "H5Cpkg.h" /* Cache */
+#include "H5FDpkg.h"
/* ============ */
/* Test Defines */
@@ -97,7 +101,7 @@ 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 = NULL; /* Data bufer (pointers to fake 2D array) */
+ int ** buf = NULL; /* Data buffer (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 */
@@ -509,7 +513,7 @@ 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 = NULL; /* Data bufer (pointers to fake 2D array) */
+ int ** buf = NULL; /* Data buffer (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 */
@@ -1883,7 +1887,7 @@ test_dset_cork(hbool_t swmr, hbool_t new_format)
{
hid_t fid = H5I_INVALID_HID; /* File ID */
hid_t fapl; /* File access property list */
- hid_t gid = H5I_INVALID_HID; /* Groupd ID */
+ hid_t gid = H5I_INVALID_HID; /* Grouped ID */
hid_t did1 = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */
hid_t tid1 = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */
hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
@@ -2244,6 +2248,19 @@ main(void)
nerrs += verify_old_dset_cork();
for (swmr = 0; swmr <= 1; swmr++) {
+ if (swmr) {
+ char *driver = NULL;
+
+ /* Skip these tests 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)) {
+ HDputs("-- SKIPPED SWMR tests for SWMR-incompatible VFD --");
+ continue;
+ }
+ }
+
/* Tests with new/old library format */
/* This is the test moved from th5o.c: test_h5o_cork() */
nerrs += test_objs_cork(swmr, TRUE);
diff --git a/test/dangle.c b/test/dangle.c
index d41507b..95d3105 100644
--- a/test/dangle.c
+++ b/test/dangle.c
@@ -660,7 +660,21 @@ error:
int
main(void)
{
- int nerrors = 0;
+ 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";
+
+ /* Don't run this test with the multi/split VFD. A bug in library shutdown
+ * ordering causes problems with the multi VFD when IDs are left dangling.
+ */
+ if (!HDstrcmp(env_h5_drvr, "multi") || !HDstrcmp(env_h5_drvr, "split")) {
+ HDputs(" -- SKIPPED for incompatible VFD --");
+ return 0;
+ }
/* Run tests w/weak file close */
HDputs("Testing dangling objects with weak file close:");
diff --git a/test/del_many_dense_attrs.c b/test/del_many_dense_attrs.c
index cf7f607..78aba3b 100644
--- a/test/del_many_dense_attrs.c
+++ b/test/del_many_dense_attrs.c
@@ -119,7 +119,7 @@ main(void)
/* Create attributes in the group */
for (i = ATTR_COUNT; i >= 0; i--) {
/* Set up the attribute name */
- HDsprintf(aname, "%s%d", basename, i);
+ HDsnprintf(aname, sizeof(aname), "%s%d", basename, i);
/* Create the attribute */
if ((aid = H5Acreate2(gid, aname, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -165,7 +165,7 @@ main(void)
/* Delete the attributes */
for (i = 0; i <= ATTR_COUNT; i++) {
/* Set up the attribute name */
- HDsprintf(aname, "%s%d", basename, i);
+ HDsnprintf(aname, sizeof(aname), "%s%d", basename, i);
/* Delete the attribute */
if (H5Adelete(gid, aname) < 0)
diff --git a/test/direct_chunk.c b/test/direct_chunk.c
index 8960784..ac4ef8d 100644
--- a/test/direct_chunk.c
+++ b/test/direct_chunk.c
@@ -686,7 +686,7 @@ filter_bogus1(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts,
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 */
+ /* Subtract the "add on" value to all the data values */
while (buf_left > 0) {
*int_ptr++ -= (int)ADD_ON;
buf_left -= sizeof(int);
@@ -722,7 +722,7 @@ filter_bogus2(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts,
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 */
+ /* Subtract the "add on" value to all the data values */
while (buf_left > 0) {
*int_ptr++ /= (int)FACTOR;
buf_left -= sizeof(int);
@@ -1427,7 +1427,7 @@ error:
* Function: test_direct_chunk_read_no_cache
*
* Purpose: Test the basic functionality of H5Dread_chunk with the
- * chunk cache diabled.
+ * chunk cache disabled.
*
* Return: Success: 0
* Failure: 1
@@ -1963,7 +1963,7 @@ error:
* 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
+ * offsets to chunks that have not been written to the dataset and are
* not allocated in the chunk storage on disk.
*
* Return: Success: 0
@@ -2014,7 +2014,7 @@ test_read_unallocated_chunk(hid_t file)
if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
FAIL_STACK_ERROR;
- /* Write a single chunk to intialize the chunk storage */
+ /* Write a single chunk to initialize the chunk storage */
HDmemset(direct_buf, 0, CHUNK_NX * CHUNK_NY * sizeof(int));
offset[0] = 0;
offset[1] = 0;
@@ -2031,7 +2031,7 @@ test_read_unallocated_chunk(hid_t file)
offset[0] = i * CHUNK_NX;
offset[1] = j * CHUNK_NY;
- /* Read a non-existant chunk using the direct read function. */
+ /* Read a non-existent chunk using the direct read function. */
H5E_BEGIN_TRY
{
status = H5Dread_chunk(dataset, dxpl, offset, &filter_mask, &direct_buf);
@@ -2042,7 +2042,7 @@ test_read_unallocated_chunk(hid_t file)
if (status != -1)
TEST_ERROR
- /* Query the size of the non-existant chunk */
+ /* Query the size of the non-existent chunk */
direct_chunk_nbytes = ULONG_MAX;
H5E_BEGIN_TRY
{
diff --git a/test/dsets.c b/test/dsets.c
index e2d281a..88e3ce0 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -835,7 +835,11 @@ error:
static herr_t
test_compact_io(hid_t fapl)
{
- hid_t file, dataset, space, plist;
+ hid_t file = H5I_INVALID_HID;
+ hid_t dataset = H5I_INVALID_HID;
+ hid_t space = H5I_INVALID_HID;
+ hid_t plist = H5I_INVALID_HID;
+
hid_t verfile = -1, new_fapl = -1;
hsize_t dims[2];
int wbuf[16][8], rbuf[16][8];
@@ -2007,7 +2011,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if (status >= 0)
TEST_ERROR;
- /* Callback decides to continue inspite data is corrupted. */
+ /* Callback decides to continue in spite 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_data) < 0)
@@ -2074,7 +2078,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if (status >= 0)
TEST_ERROR;
- /* Callback decides to continue inspite data is corrupted. */
+ /* Callback decides to continue in spite 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_data) < 0)
@@ -2138,7 +2142,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if (status >= 0)
TEST_ERROR;
- /* Callback decides to continue inspite data is corrupted. */
+ /* Callback decides to continue in spite 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_data) < 0)
@@ -2205,7 +2209,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if (status >= 0)
TEST_ERROR;
- /* Callback decides to continue inspite data is corrupted. */
+ /* Callback decides to continue in spite 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_data) < 0)
@@ -3240,7 +3244,7 @@ test_nbit_int(hid_t file)
power = HDpow(2.0, (double)(precision - 1));
orig_data[i][j] = (int)(((long long)HDrandom() % (long long)power) << offset);
- /* even-numbered values are negtive */
+ /* even-numbered values are negative */
if ((i * size[1] + j + 1) % 2 == 0)
orig_data[i][j] = -orig_data[i][j];
}
@@ -3818,7 +3822,7 @@ test_nbit_compound(hid_t file)
orig_data[i][j].s = (short)(((long long)HDrandom() % (long long)power) << offset[2]);
orig_data[i][j].f = float_val[i][j];
- /* some even-numbered integer values are negtive */
+ /* some even-numbered integer values are negative */
if ((i * size[1] + j + 1) % 2 == 0) {
orig_data[i][j].i = -orig_data[i][j].i;
orig_data[i][j].s = (short)-orig_data[i][j].s;
@@ -4532,7 +4536,7 @@ test_nbit_int_size(hid_t file)
goto error;
}
- /* Initiliaze data buffer with random data within correct range
+ /* Initialize data buffer with random data within correct range
* corresponding to the memory datatype's precision and offset.
*/
for (i = 0; i < DSET_DIM1; i++)
@@ -4745,7 +4749,7 @@ test_nbit_flt_size(hid_t file)
} /* end if */
/*
- * Initiliaze data buffer with random data
+ * Initialize data buffer with random data
*/
for (i = 0; i < DSET_DIM1; i++)
for (j = 0; j < DSET_DIM2; j++)
@@ -4904,7 +4908,7 @@ test_scaleoffset_int(hid_t file)
for (j = 0; j < (size_t)size[1]; j++) {
orig_data[i][j] = HDrandom() % 10000;
- /* even-numbered values are negtive */
+ /* even-numbered values are negative */
if ((i * size[1] + j + 1) % 2 == 0)
orig_data[i][j] = -orig_data[i][j];
}
@@ -5048,7 +5052,7 @@ test_scaleoffset_int_2(hid_t file)
for (j = 0; j < (size_t)size[1]; j++) {
orig_data[0][j] = (int)HDrandom() % 10000;
- /* even-numbered values are negtive */
+ /* even-numbered values are negative */
if ((j + 1) % 2 == 0)
orig_data[0][j] = -orig_data[0][j];
}
@@ -5170,7 +5174,7 @@ test_scaleoffset_float(hid_t file)
for (j = 0; j < (size_t)size[1]; j++) {
orig_data[i][j] = (float)(HDrandom() % 100000) / 1000.0F;
- /* even-numbered values are negtive */
+ /* even-numbered values are negative */
if ((i * size[1] + j + 1) % 2 == 0)
orig_data[i][j] = -orig_data[i][j];
}
@@ -5316,7 +5320,7 @@ test_scaleoffset_float_2(hid_t file)
for (j = 0; j < (size_t)size[1]; j++) {
orig_data[0][j] = (float)(HDrandom() % 100000) / 1000.0F;
- /* even-numbered values are negtive */
+ /* even-numbered values are negative */
if ((j + 1) % 2 == 0)
orig_data[0][j] = -orig_data[0][j];
}
@@ -5437,7 +5441,7 @@ test_scaleoffset_double(hid_t file)
for (j = 0; j < (size_t)size[1]; j++) {
orig_data[i][j] = (HDrandom() % 10000000) / 10000000.0;
- /* even-numbered values are negtive */
+ /* even-numbered values are negative */
if ((i * size[1] + j + 1) % 2 == 0)
orig_data[i][j] = -orig_data[i][j];
}
@@ -5583,7 +5587,7 @@ test_scaleoffset_double_2(hid_t file)
for (j = 0; j < (size_t)size[1]; j++) {
orig_data[0][j] = (HDrandom() % 10000000) / 10000000.0;
- /* even-numbered values are negtive */
+ /* even-numbered values are negative */
if ((j + 1) % 2 == 0)
orig_data[0][j] = -orig_data[0][j];
}
@@ -7587,9 +7591,9 @@ test_missing_chunk(hid_t file)
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 = H5I_INVALID_HID; /* 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");
@@ -8895,7 +8899,7 @@ test_chunk_cache(hid_t fapl)
if (H5Pclose(dapl2) < 0)
FAIL_STACK_ERROR
- /* Similary, test use of H5Dcreate2 with H5P_DEFAULT */
+ /* Similarly, test use of H5Dcreate2 with H5P_DEFAULT */
if (H5Dclose(dsid) < 0)
FAIL_STACK_ERROR
if ((dsid = H5Dcreate2(fid, "dset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
@@ -10722,8 +10726,8 @@ test_fixed_array(hid_t fapl)
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 = H5I_INVALID_HID; /* 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_big[1] = {POINTS_BIG}; /* Size of memory space for big dataset */
@@ -11980,7 +11984,7 @@ error:
* 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.
+ * will generate dataset with latest chunk indexing type.
*
* Return: Success: 0
* Failure: -1
@@ -14714,7 +14718,7 @@ test_versionbounds(void)
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 srcdset = -1; /* Source dataset */
hid_t vdset = -1; /* Virtual dataset */
hsize_t dims[1] = {3}; /* Data space current size */
char srcfilename[FILENAME_BUF_SIZE];
@@ -14850,7 +14854,7 @@ error:
/*-----------------------------------------------------------------------------
* Function: test_object_header_minimization_dcpl
*
- * Purpose: Test the "datset object header minimization" property as part of
+ * Purpose: Test the "dataset object header minimization" property as part of
* the DCPL.
*
* Return: Success/pass: 0
@@ -15557,15 +15561,16 @@ main(void)
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 contiguous address space */
+ hbool_t driver_uses_modified_filename = h5_driver_uses_modified_filename();
int i;
/* Don't run this test using certain file drivers */
- envval = HDgetenv("HDF5_DRIVER");
+ envval = HDgetenv(HDF5_DRIVER);
if (envval == NULL)
envval = "nomatch";
- /* Current VFD that does not support contigous address space */
+ /* Current VFD that does not support contiguous address space */
contig_addr_vfd = (hbool_t)(HDstrcmp(envval, "split") != 0 && HDstrcmp(envval, "multi") != 0);
/* Set the random # seed */
@@ -15718,7 +15723,11 @@ main(void)
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);
+
+ if (!driver_uses_modified_filename) {
+ 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_optional_filters(file) < 0 ? 1 : 0);
@@ -15727,7 +15736,11 @@ main(void)
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);
+
+ if (!driver_uses_modified_filename) {
+ 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);
@@ -15745,7 +15758,11 @@ main(void)
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);
+
+ if (!driver_uses_modified_filename) {
+ 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);
@@ -15779,7 +15796,9 @@ main(void)
nerrors += (test_gather_error() < 0 ? 1 : 0);
/* Tests version bounds using its own file */
- nerrors += (test_versionbounds() < 0 ? 1 : 0);
+ if (!driver_uses_modified_filename) {
+ nerrors += (test_versionbounds() < 0 ? 1 : 0);
+ }
/* Tests that use their own file */
nerrors += (test_object_header_minimization_dcpl() < 0 ? 1 : 0);
diff --git a/test/dt_arith.c b/test/dt_arith.c
index 7e96d29..993048a 100644
--- a/test/dt_arith.c
+++ b/test/dt_arith.c
@@ -27,7 +27,7 @@
#define FP_EPSILON 0.000001F
/*
- * Offset from alinged memory returned by malloc(). This can be used to test
+ * Offset from aligned memory returned by malloc(). This can be used to test
* that type conversions handle non-aligned buffers correctly.
*/
#define ALIGNMENT 1
@@ -79,7 +79,7 @@ typedef enum dtype_t {
* be allowed to continue (cf. Posix signals) so in order to recover from a
* SIGFPE we run tests that might generate one in a child process.
*/
-#ifdef H5_HAVE_UNISTD_H
+#if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)
#define HANDLE_SIGFPE
#endif
@@ -223,7 +223,7 @@ static int without_hardware_g = 0;
/*The number of values if multiplied by 10 for each step.*/ \
num_norm = (SRC_MAX_10_EXP - SRC_MIN_10_EXP); \
/*Reduce the number of values by 2^factor. MULTIPLY=10^(2^factor). Using this algorithm \
- *instead of arithmatic operation to avoid any conversion*/ \
+ *instead of arithmetic operation to avoid any conversion*/ \
num_norm >>= factor; \
\
/*Total number of values*/ \
@@ -640,7 +640,7 @@ test_particular_fp_integer(void)
float src_f = (float)INT_MAX;
int dst_i;
int fill_value = 13;
- int endian; /*endianess */
+ int endian; /*endianness */
unsigned int fails_this_test = 0;
size_t j;
@@ -818,7 +818,7 @@ 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; /*endianness */
size_t nelmts = NTESTELEM;
unsigned int fails_this_test = 0;
const size_t max_fails = 40; /*max number of failures*/
@@ -1267,7 +1267,7 @@ 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; /*endianness */
size_t nelmts = NTESTELEM;
unsigned int fails_this_test = 0;
const size_t max_fails = 40; /*max number of failures*/
@@ -1591,7 +1591,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
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 */
+ int endian; /*machine endianness */
size_t src_size, dst_size; /*type sizes */
unsigned char * buf = NULL; /*buffer for conversion */
unsigned char * saved = NULL; /*original values */
@@ -2831,8 +2831,8 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst)
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 */
+ int sendian; /* source type endianness */
+ int dendian; /* Destination type endianness */
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 */
@@ -3147,7 +3147,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst)
/*
* Assume same if both results are NaN. There are many NaN bit
- * patterns and the software doesn't attemt to emulate the
+ * patterns and the software doesn't attempt to emulate the
* hardware in this regard. Instead, software uses a single bit
* pattern for NaN by setting the significand to all ones.
*/
@@ -3426,8 +3426,8 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst)
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 */
+ int sendian; /*source endianness */
+ int dendian; /*destination endianness */
size_t src_size, dst_size; /*type sizes */
unsigned char * buf = NULL; /*buffer for conversion */
unsigned char * saved = NULL; /*original values */
@@ -4485,7 +4485,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst)
break;
}
- HDprintf(" ans = ");
+ HDprintf(" and = ");
for (k = 0; k < dst_size; k++)
HDprintf(" %02x", hw[ENDIAN(dst_size, k, dendian)]);
HDprintf("%*s", (int)(3 * MAX(0, (ssize_t)src_size - (ssize_t)dst_size)), "");
diff --git a/test/dtransform.c b/test/dtransform.c
index 50c33ee..1f6d48b 100644
--- a/test/dtransform.c
+++ b/test/dtransform.c
@@ -122,9 +122,8 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22,
{ \
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"; \
+ /* utrans is a transform for char types: numbers are restricted from -128 to 127, fits into char */ \
+ const char *utrans = "(x/4+25)*3"; \
\
hid_t dataspace, dxpl_id_f_to_c, dxpl_id_utrans, dset, dset_nn, dt_nn; \
H5T_order_t order; \
@@ -199,6 +198,8 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22,
COMPARE(TYPE, array, COMPARE_DATA, 2) \
} \
\
+ if (H5Dclose(dset_nn) < 0) \
+ TEST_ERROR; \
if (H5Dclose(dset) < 0) \
TEST_ERROR; \
if (H5Sclose(dataspace) < 0) \
@@ -209,9 +210,8 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22,
{ \
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"; \
+ /* utrans is a transform for char types: numbers are restricted from -128 to 127, fits into char */ \
+ const char *utrans = "(x/4+25)*3"; \
\
hid_t dataspace, dxpl_id_f_to_c, dxpl_id_utrans, cparms, memspace, dset_chunk, filespace; \
hsize_t dim[2] = {ROWS, COLS}; \
@@ -312,7 +312,7 @@ main(void)
const char *simple = "(4/2) * ( (2 + 4)/(5 - 2.5))"; /* this equals 4.8 */
const char *polynomial = "(2+x)* ((x-8)/2)";
/* inverses the utrans transform in init_test to get back original array */
- const char *utrans_inv = "(x/3)*4 - 100";
+ const char *utrans_inv = "(x/3 - 25)*4";
if ((file_id = H5Fcreate("dtransform.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
@@ -434,9 +434,8 @@ static int
init_test(hid_t file_id)
{
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";
+ /* utrans is a transform for char types: numbers are restricted from -128 to 127, fits into char */
+ const char *utrans = "(x/4+25)*3";
hid_t dataspace = -1;
hid_t dxpl_id_f_to_c = -1;
@@ -463,7 +462,7 @@ init_test(hid_t file_id)
if ((dataspace = H5Screate_simple(2, dim, NULL)) < 0)
TEST_ERROR
- TESTING("Intializing test...")
+ TESTING("Initializing test...")
if ((dset_id_int = H5Dcreate2(file_id, "/default_int", H5T_NATIVE_INT, dataspace, H5P_DEFAULT,
H5P_DEFAULT, H5P_DEFAULT)) < 0)
diff --git a/test/dtypes.c b/test/dtypes.c
index f9b4e8c..d2064b7 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -29,7 +29,7 @@
#define ARRAY_DIM 4
/*
- * Offset from alinged memory returned by malloc(). This can be used to test
+ * Offset from aligned memory returned by malloc(). This can be used to test
* that type conversions handle non-aligned buffers correctly.
*/
#define ALIGNMENT 1
@@ -2359,7 +2359,7 @@ test_compound_11(void)
TEST_ERROR
} /* end if */
if (((big_t *)buf_orig)[u].s1 == NULL || ((little_t *)buf)[u].s1 == NULL) {
- HDprintf("Error, line #%d: buf_orig[%u].s1=%p, buf[%u].s1=%p\n", __LINE__, (unsigned)u,
+ 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 */
@@ -2410,7 +2410,7 @@ test_compound_11(void)
TEST_ERROR
} /* end if */
if (((big_t *)buf_orig)[u].s1 == NULL || ((little_t *)buf)[u].s1 == NULL) {
- HDprintf("Error, line #%d: buf_orig[%u].s1=%p, buf[%u].s1=%p\n", __LINE__, (unsigned)u,
+ 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 */
@@ -2451,7 +2451,7 @@ test_compound_11(void)
TEST_ERROR
} /* end if */
if (((big_t *)buf_orig)[u].s1 == NULL || ((little_t *)buf)[u].s1 == NULL) {
- HDprintf("Error, line #%d: buf_orig[%u].s1=%p, buf[%u].s1=%p\n", __LINE__, (unsigned)u,
+ 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 */
@@ -2635,9 +2635,9 @@ test_compound_13(void)
HDmemset(&data_out, 0, sizeof(data_out));
for (u = 0; u < COMPOUND13_ARRAY_SIZE + 1; u++)
data_out.x[u] = (unsigned char)u;
- data_out.y = 99.99f;
+ data_out.y = 99.99F;
- /* Set latest_format in access propertly list to enable the latest
+ /* Set latest_format in access property list to enable the latest
* compound datatype format.
*/
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
@@ -3723,53 +3723,55 @@ test_compound_18(void)
if (H5Fclose(file) < 0)
FAIL_STACK_ERROR
- /* Open Generated File */
- /* (generated with gen_bad_compound.c) */
- if ((file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ if (!h5_driver_uses_modified_filename()) {
+ /* Open Generated File */
+ /* (generated with gen_bad_compound.c) */
+ if ((file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
- /* Try to open the datatype */
- H5E_BEGIN_TRY
- {
- tid = H5Topen2(file, "cmpnd", H5P_DEFAULT);
- }
- H5E_END_TRY;
- if (tid > 0) {
- H5Tclose(tid);
- FAIL_PUTS_ERROR("opened named datatype with bad compound datatype")
- } /* end if */
+ /* Try to open the datatype */
+ H5E_BEGIN_TRY
+ {
+ tid = H5Topen2(file, "cmpnd", H5P_DEFAULT);
+ }
+ H5E_END_TRY;
+ if (tid > 0) {
+ H5Tclose(tid);
+ FAIL_PUTS_ERROR("opened named datatype with bad compound datatype")
+ } /* end if */
- /* Try to open the dataset */
- H5E_BEGIN_TRY
- {
- did = H5Dopen2(file, "dataset", H5P_DEFAULT);
- }
- H5E_END_TRY;
- if (did > 0) {
- H5Dclose(did);
- FAIL_PUTS_ERROR("opened dataset with bad compound datatype")
- } /* end if */
+ /* Try to open the dataset */
+ H5E_BEGIN_TRY
+ {
+ did = H5Dopen2(file, "dataset", H5P_DEFAULT);
+ }
+ H5E_END_TRY;
+ if (did > 0) {
+ H5Dclose(did);
+ FAIL_PUTS_ERROR("opened dataset with bad compound datatype")
+ } /* end if */
- /* Open the group with the attribute */
- if ((gid = H5Gopen2(file, "group", H5P_DEFAULT)) < 0)
- TEST_ERROR
+ /* Open the group with the attribute */
+ if ((gid = H5Gopen2(file, "group", H5P_DEFAULT)) < 0)
+ TEST_ERROR
- /* Try to open the dataset */
- H5E_BEGIN_TRY
- {
- aid = H5Aopen(gid, "attr", H5P_DEFAULT);
- }
- H5E_END_TRY;
- if (aid > 0) {
- H5Aclose(aid);
- FAIL_PUTS_ERROR("opened attribute with bad compound datatype")
- } /* end if */
+ /* Try to open the dataset */
+ H5E_BEGIN_TRY
+ {
+ aid = H5Aopen(gid, "attr", H5P_DEFAULT);
+ }
+ H5E_END_TRY;
+ if (aid > 0) {
+ H5Aclose(aid);
+ FAIL_PUTS_ERROR("opened attribute with bad compound datatype")
+ } /* end if */
- /* Close IDs */
- if (H5Gclose(gid) < 0)
- FAIL_STACK_ERROR
- if (H5Fclose(file) < 0)
- FAIL_STACK_ERROR
+ /* Close IDs */
+ if (H5Gclose(gid) < 0)
+ FAIL_STACK_ERROR
+ if (H5Fclose(file) < 0)
+ FAIL_STACK_ERROR
+ }
PASSED();
return 0;
@@ -3792,7 +3794,7 @@ error:
*
* Modifications:
* Raymond Lu
- * Wednesday, Febuary 9, 2005
+ * Wednesday, February 9, 2005
* Added test for H5Tenum_valueof, H5Tenum_nameof, and
* H5Tget_member_value.
*-------------------------------------------------------------------------
@@ -4967,7 +4969,7 @@ test_conv_str_2(void)
} /* end for */
/* Do the conversions */
- HDsprintf(s, "Testing random string conversion speed");
+ HDsnprintf(s, sizeof(s), "Testing random string conversion speed");
HDprintf("%-70s", s);
HDfflush(stdout);
if (H5Tconvert(c_type, f_type, nelmts, buf, NULL, H5P_DEFAULT) < 0)
@@ -5182,14 +5184,14 @@ test_conv_enum_1(void)
buf[u] = HDrand() % 26;
/* Conversions */
- HDsprintf(s, "Testing random enum conversion O(N)");
+ HDsnprintf(s, sizeof(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();
- HDsprintf(s, "Testing random enum conversion O(N log N)");
+ HDsnprintf(s, sizeof(s), "Testing random enum conversion O(N log N)");
HDprintf("%-70s", s);
HDfflush(stdout);
if (H5Tconvert(t2, t1, nelmts, buf, NULL, H5P_DEFAULT) < 0)
@@ -6845,7 +6847,7 @@ test_set_order(void)
{
hid_t dtype; /* Datatype ID */
H5T_order_t order; /* Byte order */
- hsize_t dims[2] = {3, 4}; /* Array dimenstions */
+ hsize_t dims[2] = {3, 4}; /* Array dimensions */
herr_t ret; /* Generic return value */
TESTING("H5Tset/get_order");
@@ -7093,7 +7095,7 @@ test_set_order_compound(hid_t fapl)
hid_t file = -1;
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 */
+ hsize_t dims[2] = {3, 4}; /* Array dimensions */
char filename[1024];
herr_t ret; /* Generic return value */
@@ -7948,7 +7950,7 @@ test_deprec(hid_t fapl)
unsigned u; /* Local index variable */
herr_t status; /* Generic routine value */
- TESTING("deprected API routines for datatypes");
+ TESTING("deprecated API routines for datatypes");
/* Create an array datatype with an atomic base type */
/* (dimension permutations allowed, but not stored) */
diff --git a/test/earray.c b/test/earray.c
index 337e818..7c8dd1f 100644
--- a/test/earray.c
+++ b/test/earray.c
@@ -1284,7 +1284,7 @@ typedef struct eiter_fw_t {
/*-------------------------------------------------------------------------
* Function: eiter_fw_init
*
- * Purpose: Initialize element interator (forward iteration)
+ * Purpose: Initialize element iterator (forward iteration)
*
* Return: Success: Pointer to iteration status object
* Failure: NULL
@@ -1428,7 +1428,7 @@ eiter_fw_state(void *in_eiter, const H5EA_create_t *cparam, const earray_test_pa
/*-------------------------------------------------------------------------
* Function: eiter_fw_term
*
- * Purpose: Shut down element interator (forward iteration)
+ * Purpose: Shut down element iterator (forward iteration)
*
* Return: Success: 0
* Failure: -1
@@ -1472,7 +1472,7 @@ typedef struct eiter_rv_t {
/*-------------------------------------------------------------------------
* Function: eiter_rv_init
*
- * Purpose: Initialize element interator (reverse iteration)
+ * Purpose: Initialize element iterator (reverse iteration)
*
* Return: Success: Pointer to iteration status object
* Failure: NULL
@@ -1653,7 +1653,7 @@ eiter_rv_state(void *in_eiter, const H5EA_create_t *cparam, const earray_test_pa
/*-------------------------------------------------------------------------
* Function: eiter_rv_term
*
- * Purpose: Shut down element interator (reverse iteration)
+ * Purpose: Shut down element iterator (reverse iteration)
*
* Return: Success: 0
* Failure: -1
@@ -1694,7 +1694,7 @@ typedef struct eiter_rnd_t {
/*-------------------------------------------------------------------------
* Function: eiter_rnd_init
*
- * Purpose: Initialize element interator (random iteration)
+ * Purpose: Initialize element iterator (random iteration)
*
* Return: Success: Pointer to iteration status object
* Failure: NULL
@@ -1803,7 +1803,7 @@ eiter_rnd_max(const void *in_eiter)
/*-------------------------------------------------------------------------
* Function: eiter_rnd_term
*
- * Purpose: Shut down element interator (random iteration)
+ * Purpose: Shut down element iterator (random iteration)
*
* Return: Success: 0
* Failure: -1
@@ -1843,7 +1843,7 @@ static const earray_iter_t ea_iter_rnd = {
/*-------------------------------------------------------------------------
* Function: eiter_rnd2_init
*
- * Purpose: Initialize element interator (random #2 iteration)
+ * Purpose: Initialize element iterator (random #2 iteration)
*
* Return: Success: Pointer to iteration status object
* Failure: NULL
@@ -1926,7 +1926,7 @@ typedef struct eiter_cyc_t {
/*-------------------------------------------------------------------------
* Function: eiter_cyc_init
*
- * Purpose: Initialize element interator (cyclic iteration)
+ * Purpose: Initialize element iterator (cyclic iteration)
*
* Return: Success: Pointer to iteration status object
* Failure: NULL
@@ -2019,7 +2019,7 @@ eiter_cyc_max(const void *in_eiter)
/*-------------------------------------------------------------------------
* Function: eiter_cyc_term
*
- * Purpose: Shut down element interator (cyclic iteration)
+ * Purpose: Shut down element iterator (cyclic iteration)
*
* Return: Success: 0
* Failure: -1
@@ -2543,15 +2543,16 @@ main(void)
/* Test first element in data block */
nelmts = (hsize_t)((hsize_t)1 + cparam.idx_blk_elmts + tparam.sblk_info[sblk].start_idx +
(tparam.sblk_info[sblk].dblk_nelmts * dblk));
- HDsprintf(test_str, "setting first element of array's data block #%llu",
- (unsigned long long)ndblks);
+ HDsnprintf(test_str, sizeof(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)));
- HDsprintf(test_str, "setting all elements of array's data block #%llu",
- (unsigned long long)ndblks);
+ HDsnprintf(test_str, sizeof(test_str), "setting all elements of array's data block #%llu",
+ (unsigned long long)ndblks);
nerrors += test_set_elmts(fapl, &cparam, &tparam, nelmts, test_str);
/* Increment data block being tested */
diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c
index 60b229a..0a73273 100644
--- a/test/enc_dec_plist.c
+++ b/test/enc_dec_plist.c
@@ -199,8 +199,8 @@ main(void)
/* 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);
+ HDsnprintf(msg, sizeof(msg),
+ "Testing ENCODE/DECODE with file version bounds: (%s, %s):", low_string, high_string);
HDputs(msg);
if (VERBOSE_MED)
diff --git a/test/enc_dec_plist_cross_platform.c b/test/enc_dec_plist_cross_platform.c
index 9ea5cf9..3030d7c 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)
- HDprintf("Encode/Decode property list endianess\n");
+ HDprintf("Encode/Decode property list endianness\n");
/******* ENCODE/DECODE DCPLS *****/
TESTING("Default DCPL Encoding/Decoding");
diff --git a/test/enum.c b/test/enum.c
index 3923892..512fd9d 100644
--- a/test/enum.c
+++ b/test/enum.c
@@ -552,7 +552,7 @@ test_value_dsnt_exist(void)
if ((datatype_id = H5Tenum_create(H5T_NATIVE_INT)) < 0)
goto error;
- /* These calls should fail, since no memebrs exist yet */
+ /* These calls should fail, since no members exist yet */
if (H5Tenum_valueof(datatype_id, "SAX", &val) >= 0)
goto error;
val = 3;
diff --git a/test/error_test.c b/test/error_test.c
index f4dc340..9ac76dd 100644
--- a/test/error_test.c
+++ b/test/error_test.c
@@ -738,7 +738,7 @@ error:
*-------------------------------------------------------------------------
*/
static herr_t
-test_filter_error(const char *fname)
+test_filter_error(const char *fname, hid_t fapl)
{
const char *pathname = H5_get_srcdir_filename(fname); /* Corrected test file name */
hid_t file = -1;
@@ -748,7 +748,7 @@ test_filter_error(const char *fname)
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, fapl)) < 0)
TEST_ERROR;
/* Open the regular dataset */
@@ -785,9 +785,15 @@ main(void)
hid_t fapl = -1;
hid_t estack_id = -1;
char filename[1024];
+ const char *env_h5_drvr; /* File driver value from environment */
const char *FUNC_main = "main";
int i;
+ /* Get the VFD to use */
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
+ if (env_h5_drvr == NULL)
+ env_h5_drvr = "nomatch";
+
HDfprintf(stderr, " This program tests the Error API. There're supposed to be some error messages\n");
/* Initialize errors */
@@ -877,7 +883,15 @@ main(void)
* the test file was pre-generated.
*/
h5_fixname(DATAFILE, H5P_DEFAULT, filename, sizeof filename);
- if (test_filter_error(filename) < 0)
+ if (!h5_using_default_driver(env_h5_drvr) && HDstrcmp(env_h5_drvr, "stdio")) {
+ /* If not using the library's default VFD or the stdio VFD, force
+ * the library's default VFD here. The test file was pre-generated
+ * and can cause issues with many VFDs.
+ */
+ if (H5Pset_driver(fapl, H5_DEFAULT_VFD, NULL) < 0)
+ TEST_ERROR;
+ }
+ if (test_filter_error(filename, fapl) < 0)
TEST_ERROR;
h5_clean_files(FILENAME, fapl);
diff --git a/test/event_set.c b/test/event_set.c
index 5df49e9..c2a17b1 100644
--- a/test/event_set.c
+++ b/test/event_set.c
@@ -19,8 +19,157 @@
#include "h5test.h"
#include "H5srcdir.h"
+#define EVENT_SET_NUM_CONNECTOR_IDS 2
+
const char *FILENAME[] = {"event_set_1", NULL};
+hid_t connector_ids_g[EVENT_SET_NUM_CONNECTOR_IDS];
+
+herr_t fake_wait_request_wait(void *req, uint64_t timeout, H5VL_request_status_t *status);
+herr_t fake_wait_request_free(void *req);
+
+/* A VOL class struct that describes a VOL class with no
+ * functionality, other than a wait that returns success.
+ */
+static const H5VL_class_t fake_wait_vol_g = {
+ H5VL_VERSION, /* VOL class struct version */
+ ((H5VL_class_value_t)501), /* value */
+ "fake_wait", /* name */
+ 0, /* connector version */
+ 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 */
+ 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, /* get_cap_flags */
+ NULL, /* opt_query */
+ },
+ {
+ /* request_cls */
+ fake_wait_request_wait, /* wait */
+ NULL, /* notify */
+ NULL, /* cancel */
+ NULL, /* specific */
+ NULL, /* optional */
+ fake_wait_request_free /* free */
+ },
+ {
+ /* blob_cls */
+ NULL, /* put */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL /* optional */
+ },
+ {
+ /* token_cls */
+ NULL, /* cmp */
+ NULL, /* to_str */
+ NULL /* from_str */
+ },
+ NULL /* optional */
+};
+
+herr_t
+fake_wait_request_wait(void H5_ATTR_UNUSED *req, uint64_t H5_ATTR_UNUSED timeout,
+ H5VL_request_status_t *status)
+{
+ /* Set status if requested */
+ if (status)
+ *status = H5VL_REQUEST_STATUS_SUCCEED;
+
+ return 0;
+} /* end H5_daos_req_wait() */
+
+herr_t
+fake_wait_request_free(void H5_ATTR_UNUSED *req)
+{
+ return 0;
+} /* end fake_wait_request_free() */
+
/*-------------------------------------------------------------------------
* Function: test_es_create
*
@@ -159,6 +308,348 @@ error:
}
/*-------------------------------------------------------------------------
+ * Function: test_es_get_requests
+ *
+ * Purpose: Tests getting requests from event set.
+ *
+ * Return: Success: 0
+ * Failure: number of errors
+ *
+ * Programmer: Neil Fortner
+ * Wednesday, November 24, 2021
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+test_es_get_requests(void)
+{
+ hid_t es_id; /* Event set ID */
+ hid_t connector_ids[2]; /* Connector IDs */
+ void * requests[2]; /* Requests */
+ int req_targets[2]; /* Dummy targets for void * requests */
+ size_t count; /* # of events in set */
+ hbool_t op_failed; /* Whether an operation failed (unused) */
+
+ TESTING("event set get requests");
+
+ /* Create an event set */
+ if ((es_id = H5EScreate()) < 0)
+ TEST_ERROR
+
+ /* Get number of requests in event set */
+ count = 3;
+ if (H5ESget_requests(es_id, H5_ITER_NATIVE, NULL, NULL, 0, &count) < 0)
+ TEST_ERROR
+ if (count != 0)
+ TEST_ERROR
+
+ /* Get only connector IDs */
+ count = 3;
+ connector_ids[0] = H5I_INVALID_HID;
+ connector_ids[1] = H5I_INVALID_HID;
+ if (H5ESget_requests(es_id, H5_ITER_NATIVE, connector_ids, NULL, 2, &count) < 0)
+ TEST_ERROR
+ if (count != 0)
+ TEST_ERROR
+ if (connector_ids[0] != H5I_INVALID_HID)
+ TEST_ERROR
+ if (connector_ids[1] != H5I_INVALID_HID)
+ TEST_ERROR
+
+ /* Get only requests */
+ count = 3;
+ requests[0] = NULL;
+ requests[1] = NULL;
+ if (H5ESget_requests(es_id, H5_ITER_NATIVE, NULL, requests, 2, &count) < 0)
+ TEST_ERROR
+ if (count != 0)
+ TEST_ERROR
+ if (requests[0] != NULL)
+ TEST_ERROR
+ if (requests[1] != NULL)
+ TEST_ERROR
+
+ /* Get both */
+ count = 3;
+ connector_ids[0] = H5I_INVALID_HID;
+ connector_ids[1] = H5I_INVALID_HID;
+ requests[0] = NULL;
+ requests[1] = NULL;
+ if (H5ESget_requests(es_id, H5_ITER_NATIVE, connector_ids, requests, 2, &count) < 0)
+ TEST_ERROR
+ if (count != 0)
+ TEST_ERROR
+ if (connector_ids[0] != H5I_INVALID_HID)
+ TEST_ERROR
+ if (connector_ids[1] != H5I_INVALID_HID)
+ TEST_ERROR
+ if (requests[0] != NULL)
+ TEST_ERROR
+ if (requests[1] != NULL)
+ TEST_ERROR
+
+ /* Insert event into event set */
+ if (H5ESinsert_request(es_id, connector_ids_g[0], &req_targets[0]) < 0)
+ TEST_ERROR
+
+ /* Get number of requests in event set */
+ count = 0;
+ if (H5ESget_requests(es_id, H5_ITER_NATIVE, NULL, NULL, 0, &count) < 0)
+ TEST_ERROR
+ if (count != 1)
+ TEST_ERROR
+
+ /* Get only connector IDs */
+ count = 0;
+ connector_ids[0] = H5I_INVALID_HID;
+ connector_ids[1] = H5I_INVALID_HID;
+ if (H5ESget_requests(es_id, H5_ITER_NATIVE, connector_ids, NULL, 2, &count) < 0)
+ TEST_ERROR
+ if (count != 1)
+ TEST_ERROR
+ if (connector_ids[0] != connector_ids_g[0])
+ TEST_ERROR
+ if (connector_ids[1] != H5I_INVALID_HID)
+ TEST_ERROR
+
+ /* Get only requests */
+ count = 0;
+ requests[0] = NULL;
+ requests[1] = NULL;
+ if (H5ESget_requests(es_id, H5_ITER_NATIVE, NULL, requests, 2, &count) < 0)
+ TEST_ERROR
+ if (count != 1)
+ TEST_ERROR
+ if (requests[0] != &req_targets[0])
+ TEST_ERROR
+ if (requests[1] != NULL)
+ TEST_ERROR
+
+ /* Get both */
+ count = 0;
+ connector_ids[0] = H5I_INVALID_HID;
+ connector_ids[1] = H5I_INVALID_HID;
+ requests[0] = NULL;
+ requests[1] = NULL;
+ if (H5ESget_requests(es_id, H5_ITER_NATIVE, connector_ids, requests, 2, &count) < 0)
+ TEST_ERROR
+ if (count != 1)
+ TEST_ERROR
+ if (connector_ids[0] != connector_ids_g[0])
+ TEST_ERROR
+ if (connector_ids[1] != H5I_INVALID_HID)
+ TEST_ERROR
+ if (requests[0] != &req_targets[0])
+ TEST_ERROR
+ if (requests[1] != NULL)
+ TEST_ERROR
+
+ /* Insert second event into event set */
+ if (H5ESinsert_request(es_id, connector_ids_g[1], &req_targets[1]) < 0)
+ TEST_ERROR
+
+ /* Get number of requests in event set */
+ count = 0;
+ if (H5ESget_requests(es_id, H5_ITER_NATIVE, NULL, NULL, 0, &count) < 0)
+ TEST_ERROR
+ if (count != 2)
+ TEST_ERROR
+
+ /* Get only connector IDs */
+ count = 0;
+ connector_ids[0] = H5I_INVALID_HID;
+ connector_ids[1] = H5I_INVALID_HID;
+ if (H5ESget_requests(es_id, H5_ITER_INC, connector_ids, NULL, 2, &count) < 0)
+ TEST_ERROR
+ if (count != 2)
+ TEST_ERROR
+ if (connector_ids[0] != connector_ids_g[0])
+ TEST_ERROR
+ if (connector_ids[1] != connector_ids_g[1])
+ TEST_ERROR
+
+ /* Try with H5_ITER_DEC */
+ count = 0;
+ connector_ids[0] = H5I_INVALID_HID;
+ connector_ids[1] = H5I_INVALID_HID;
+ if (H5ESget_requests(es_id, H5_ITER_DEC, connector_ids, NULL, 2, &count) < 0)
+ TEST_ERROR
+ if (count != 2)
+ TEST_ERROR
+ if (connector_ids[0] != connector_ids_g[1])
+ TEST_ERROR
+ if (connector_ids[1] != connector_ids_g[0])
+ TEST_ERROR
+
+ /* Get only requests */
+ count = 0;
+ requests[0] = NULL;
+ requests[1] = NULL;
+ if (H5ESget_requests(es_id, H5_ITER_INC, NULL, requests, 2, &count) < 0)
+ TEST_ERROR
+ if (count != 2)
+ TEST_ERROR
+ if (requests[0] != &req_targets[0])
+ TEST_ERROR
+ if (requests[1] != &req_targets[1])
+ TEST_ERROR
+
+ /* Try with H5_ITER_DEC */
+ count = 0;
+ requests[0] = NULL;
+ requests[1] = NULL;
+ if (H5ESget_requests(es_id, H5_ITER_DEC, NULL, requests, 2, &count) < 0)
+ TEST_ERROR
+ if (count != 2)
+ TEST_ERROR
+ if (requests[0] != &req_targets[1])
+ TEST_ERROR
+ if (requests[1] != &req_targets[0])
+ TEST_ERROR
+
+ /* Get both */
+ count = 0;
+ connector_ids[0] = H5I_INVALID_HID;
+ connector_ids[1] = H5I_INVALID_HID;
+ requests[0] = NULL;
+ requests[1] = NULL;
+ if (H5ESget_requests(es_id, H5_ITER_INC, connector_ids, requests, 2, &count) < 0)
+ TEST_ERROR
+ if (count != 2)
+ TEST_ERROR
+ if (connector_ids[0] != connector_ids_g[0])
+ TEST_ERROR
+ if (connector_ids[1] != connector_ids_g[1])
+ TEST_ERROR
+ if (requests[0] != &req_targets[0])
+ TEST_ERROR
+ if (requests[1] != &req_targets[1])
+ TEST_ERROR
+
+ /* Try with H5_ITER_DEC */
+ count = 0;
+ connector_ids[0] = H5I_INVALID_HID;
+ connector_ids[1] = H5I_INVALID_HID;
+ requests[0] = NULL;
+ requests[1] = NULL;
+ if (H5ESget_requests(es_id, H5_ITER_DEC, connector_ids, requests, 2, &count) < 0)
+ TEST_ERROR
+ if (count != 2)
+ TEST_ERROR
+ if (connector_ids[0] != connector_ids_g[1])
+ TEST_ERROR
+ if (connector_ids[1] != connector_ids_g[0])
+ TEST_ERROR
+ if (requests[0] != &req_targets[1])
+ TEST_ERROR
+ if (requests[1] != &req_targets[0])
+ TEST_ERROR
+
+ /* Get only first connector ID */
+ count = 0;
+ connector_ids[0] = H5I_INVALID_HID;
+ connector_ids[1] = H5I_INVALID_HID;
+ if (H5ESget_requests(es_id, H5_ITER_INC, connector_ids, NULL, 1, &count) < 0)
+ TEST_ERROR
+ if (count != 2)
+ TEST_ERROR
+ if (connector_ids[0] != connector_ids_g[0])
+ TEST_ERROR
+ if (connector_ids[1] != H5I_INVALID_HID)
+ TEST_ERROR
+
+ /* Try with H5_ITER_DEC */
+ count = 0;
+ connector_ids[0] = H5I_INVALID_HID;
+ connector_ids[1] = H5I_INVALID_HID;
+ if (H5ESget_requests(es_id, H5_ITER_DEC, connector_ids, NULL, 1, &count) < 0)
+ TEST_ERROR
+ if (count != 2)
+ TEST_ERROR
+ if (connector_ids[0] != connector_ids_g[1])
+ TEST_ERROR
+ if (connector_ids[1] != H5I_INVALID_HID)
+ TEST_ERROR
+
+ /* Get only first request */
+ count = 0;
+ requests[0] = NULL;
+ requests[1] = NULL;
+ if (H5ESget_requests(es_id, H5_ITER_INC, NULL, requests, 1, &count) < 0)
+ TEST_ERROR
+ if (count != 2)
+ TEST_ERROR
+ if (requests[0] != &req_targets[0])
+ TEST_ERROR
+ if (requests[1] != NULL)
+ TEST_ERROR
+
+ /* Try with H5_ITER_DEC */
+ count = 0;
+ requests[0] = NULL;
+ requests[1] = NULL;
+ if (H5ESget_requests(es_id, H5_ITER_DEC, NULL, requests, 1, &count) < 0)
+ TEST_ERROR
+ if (count != 2)
+ TEST_ERROR
+ if (requests[0] != &req_targets[1])
+ TEST_ERROR
+ if (requests[1] != NULL)
+ TEST_ERROR
+
+ /* Get only first of both */
+ count = 0;
+ connector_ids[0] = H5I_INVALID_HID;
+ connector_ids[1] = H5I_INVALID_HID;
+ requests[0] = NULL;
+ requests[1] = NULL;
+ if (H5ESget_requests(es_id, H5_ITER_INC, connector_ids, requests, 1, &count) < 0)
+ TEST_ERROR
+ if (connector_ids[0] != connector_ids_g[0])
+ TEST_ERROR
+ if (connector_ids[1] != H5I_INVALID_HID)
+ TEST_ERROR
+ if (requests[0] != &req_targets[0])
+ TEST_ERROR
+ if (requests[1] != NULL)
+ TEST_ERROR
+
+ /* Try with H5_ITER_DEC */
+ count = 0;
+ connector_ids[0] = H5I_INVALID_HID;
+ connector_ids[1] = H5I_INVALID_HID;
+ requests[0] = NULL;
+ requests[1] = NULL;
+ if (H5ESget_requests(es_id, H5_ITER_DEC, connector_ids, requests, 1, &count) < 0)
+ TEST_ERROR
+ if (connector_ids[0] != connector_ids_g[1])
+ TEST_ERROR
+ if (connector_ids[1] != H5I_INVALID_HID)
+ TEST_ERROR
+ if (requests[0] != &req_targets[1])
+ TEST_ERROR
+ if (requests[1] != NULL)
+ TEST_ERROR
+
+ /* Close the event set */
+ if (H5ESwait(es_id, 10000000, &count, &op_failed) < 0)
+ TEST_ERROR
+ if (H5ESclose(es_id) < 0)
+ TEST_ERROR
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ H5ESclose(es_id);
+ }
+ H5E_END_TRY;
+ return 1;
+}
+
+/*-------------------------------------------------------------------------
* Function: main
*
* Purpose: Tests event sets
@@ -175,27 +666,41 @@ int
main(void)
{
hid_t fapl_id = H5I_INVALID_HID; /* File access property list */
+ int i; /* Local index variable */
int nerrors = 0; /* Error count */
/* Setup */
h5_reset();
fapl_id = h5_fileaccess();
+ /* Register dummy connector IDs */
+ for (i = 0; i < EVENT_SET_NUM_CONNECTOR_IDS; i++)
+ if ((connector_ids_g[i] = H5VLregister_connector(&fake_wait_vol_g, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
/* Tests */
nerrors += test_es_create();
nerrors += test_es_none();
+ nerrors += test_es_get_requests();
+
+ /* Unregister dummy connectors */
+ for (i = 0; i < EVENT_SET_NUM_CONNECTOR_IDS; i++)
+ if (H5VLunregister_connector(connector_ids_g[i]) < 0)
+ TEST_ERROR
/* Cleanup */
h5_cleanup(FILENAME, fapl_id);
/* Check for any errors */
- if (nerrors) {
- HDputs("***** EVENT SET TESTS FAILED *****");
- HDexit(EXIT_FAILURE);
- } /* end if */
+ if (nerrors)
+ goto error;
/* Report status */
HDputs("All event set tests passed.");
HDexit(EXIT_SUCCESS);
+
+error:
+ HDputs("***** EVENT SET TESTS FAILED *****");
+ HDexit(EXIT_FAILURE);
} /* end main() */
diff --git a/test/external.c b/test/external.c
index c31701d..11185b3 100644
--- a/test/external.c
+++ b/test/external.c
@@ -890,8 +890,8 @@ test_write_file_set(hid_t fapl)
for (i = 0; i < N_EXT_FILES; i++) {
char name1[64], name2[64];
- HDsprintf(name1, "extern_%dr.raw", i + 1);
- HDsprintf(name2, "extern_%dw.raw", i + 1);
+ HDsnprintf(name1, sizeof(name1), "extern_%dr.raw", i + 1);
+ HDsnprintf(name2, sizeof(name2), "extern_%dw.raw", i + 1);
if (!files_have_same_contents(name1, name2))
FAIL_PUTS_ERROR(" Output differs from expected value.")
} /* end for */
@@ -1217,7 +1217,7 @@ test_path_relative_cwd(hid_t fapl)
}
H5E_END_TRY;
if (dset3 >= 0)
- FAIL_PUTS_ERROR("reopening the dataset with a different efile_prefix succeded");
+ FAIL_PUTS_ERROR("reopening the dataset with a different efile_prefix succeeded");
/* Read the entire dataset and compare with the original */
HDmemset(whole, 0, sizeof(whole));
@@ -1233,7 +1233,7 @@ test_path_relative_cwd(hid_t fapl)
if (H5Dclose(dset) < 0)
FAIL_STACK_ERROR
- /* Open dataset (use a differend prefix than for create.
+ /* Open dataset (use a different prefix than for create.
* This works because the dataset was closed.
*/
if (H5Pset_efile_prefix(dapl2, "${ORIGIN}/.") < 0)
@@ -1254,7 +1254,7 @@ test_path_relative_cwd(hid_t fapl)
}
H5E_END_TRY;
if (dset3 >= 0)
- FAIL_PUTS_ERROR("reopening the dataset with a different efile_prefix succeded");
+ FAIL_PUTS_ERROR("reopening the dataset with a different efile_prefix succeeded");
/* Read the entire dataset and compare with the original */
HDmemset(whole, 0, sizeof(whole));
diff --git a/test/external_common.c b/test/external_common.c
index c37fd16..3f04260 100644
--- a/test/external_common.c
+++ b/test/external_common.c
@@ -59,9 +59,9 @@ reset_raw_data_files(hbool_t is_env)
/* Open file */
if (is_env)
- HDsprintf(filename, "extern_env_%lur.raw", (unsigned long)i + 1);
+ HDsnprintf(filename, sizeof(filename), "extern_env_%lur.raw", (unsigned long)i + 1);
else
- HDsprintf(filename, "extern_%lur.raw", (unsigned long)i + 1);
+ HDsnprintf(filename, sizeof(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;
@@ -96,9 +96,9 @@ reset_raw_data_files(hbool_t is_env)
/* Open file */
if (is_env)
- HDsprintf(filename, "extern_env_%luw.raw", (unsigned long)i + 1);
+ HDsnprintf(filename, sizeof(filename), "extern_env_%luw.raw", (unsigned long)i + 1);
else
- HDsprintf(filename, "extern_%luw.raw", (unsigned long)i + 1);
+ HDsnprintf(filename, sizeof(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;
diff --git a/test/family_v16_00000.h5 b/test/family_v16-000000.h5
index ac75ea9..ac75ea9 100644
--- a/test/family_v16_00000.h5
+++ b/test/family_v16-000000.h5
Binary files differ
diff --git a/test/family_v16_00001.h5 b/test/family_v16-000001.h5
index bf55b32..bf55b32 100644
--- a/test/family_v16_00001.h5
+++ b/test/family_v16-000001.h5
Binary files differ
diff --git a/test/family_v16_00002.h5 b/test/family_v16-000002.h5
index 9bd0891..9bd0891 100644
--- a/test/family_v16_00002.h5
+++ b/test/family_v16-000002.h5
Binary files differ
diff --git a/test/family_v16_00003.h5 b/test/family_v16-000003.h5
index fedce2a..fedce2a 100644
--- a/test/family_v16_00003.h5
+++ b/test/family_v16-000003.h5
Binary files differ
diff --git a/test/farray.c b/test/farray.c
index 950c7a7..d31d77a 100644
--- a/test/farray.c
+++ b/test/farray.c
@@ -969,7 +969,7 @@ typedef struct fiter_fw_t {
/*-------------------------------------------------------------------------
* Function: fiter_fw_init
*
- * Purpose: Initialize element interator (forward iteration)
+ * Purpose: Initialize element iterator (forward iteration)
*
* Return: Success: Pointer to iteration status object
* Failure: NULL
@@ -1021,7 +1021,7 @@ fiter_fw_next(void *_fiter)
/*-------------------------------------------------------------------------
* Function: fiter_term
*
- * Purpose: Shut down element interator (simple iterators)
+ * Purpose: Shut down element iterator (simple iterators)
*
* Return: Success: 0
* Failure: -1
@@ -1055,7 +1055,7 @@ typedef struct fiter_rv_t {
/*-------------------------------------------------------------------------
* Function: fiter_rv_init
*
- * Purpose: Initialize element interator (reverse iteration)
+ * Purpose: Initialize element iterator (reverse iteration)
*
* Return: Success: Pointer to iteration status object
* Failure: NULL
@@ -1120,7 +1120,7 @@ typedef struct fiter_rnd_t {
/*-------------------------------------------------------------------------
* Function: fiter_rnd_init
*
- * Purpose: Initialize element interator (random iteration)
+ * Purpose: Initialize element iterator (random iteration)
*
* Return: Success: Pointer to iteration status object
* Failure: NULL
@@ -1193,7 +1193,7 @@ fiter_rnd_next(void *_fiter)
/*-------------------------------------------------------------------------
* Function: fiter_rnd_term
*
- * Purpose: Shut down element interator (random iteration)
+ * Purpose: Shut down element iterator (random iteration)
*
* Return: Success: 0
* Failure: -1
@@ -1235,7 +1235,7 @@ typedef struct fiter_cyc_t {
/*-------------------------------------------------------------------------
* Function: fiter_cyc_init
*
- * Purpose: Initialize element interator (cyclic iteration)
+ * Purpose: Initialize element iterator (cyclic iteration)
*
* Return: Success: Pointer to iteration status object
* Failure: NULL
diff --git a/test/fheap.c b/test/fheap.c
index 86a555d..b897063 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -466,40 +466,24 @@ error:
return (1);
} /* add_obj() */
-/*-------------------------------------------------------------------------
- * Function: get_del_string
- *
- * Purpose: Return string describing the kind of deletion to perform
- *
- * Return: Success: 0
- *
- * Failure: 1
- *
- * Programmer: Quincey Koziol
- * Monday, June 6, 2006
- *
- *-------------------------------------------------------------------------
- */
-static char *
+/* Return a string describing the kind of deletion to perform. */
+static const char *
get_del_string(const fheap_test_param_t *tparam)
{
- char *str;
-
/* Remove half of total objects from heap */
if (tparam->del_dir == FHEAP_DEL_FORWARD)
if (tparam->drain_half == FHEAP_DEL_DRAIN_ALL)
- str = H5MM_strdup("(all - forward)");
+ return "(all - forward)";
else
- str = H5MM_strdup("(half, refill, all - forward)");
+ return "(half, refill, all - forward)";
else if (tparam->del_dir == FHEAP_DEL_REVERSE)
if (tparam->drain_half == FHEAP_DEL_DRAIN_ALL)
- str = H5MM_strdup("(all - reverse)");
+ return "(all - reverse)";
else
- str = H5MM_strdup("(half, refill, all - reverse)");
+ return "(half, refill, all - reverse)";
else
- str = H5MM_strdup("(all - deleting heap)");
+ return "(all - deleting heap)";
- return (str);
} /* get_del_string() */
/*-------------------------------------------------------------------------
@@ -547,28 +531,20 @@ 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_CLANG_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)
{
- char *del_str = NULL; /* Deletion order description */
- char *test_desc = NULL; /* Test description */
+ char * test_desc; /* Test description */
+ const char *del_str = get_del_string(tparam);
/*
* Test filling & removing all (small) objects from root direct block of absolute heap
*/
- del_str = get_del_string(tparam);
- HDassert(del_str);
- test_desc = (char *)H5MM_malloc(HDstrlen(del_str) + HDstrlen(base_desc));
- HDsprintf(test_desc, base_desc, del_str);
+ size_t test_desc_len = strlen(base_desc) + sizeof(" ") + strlen(del_str);
+ test_desc = H5MM_malloc(test_desc_len);
+ (void)HDsnprintf(test_desc, test_desc_len, "%s %s", base_desc, del_str);
+
TESTING(test_desc);
- H5MM_xfree(del_str);
H5MM_xfree(test_desc);
/* Initialize the heap ID structure */
@@ -581,7 +557,6 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc, fheap_heap_ids_t *
/* Success */
return (0);
} /* end begin_test() */
-H5_GCC_CLANG_DIAG_ON("format-nonliteral")
/*-------------------------------------------------------------------------
* Function: reopen_file
@@ -2469,7 +2444,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
size_t id_len; /* Size of fractal heap IDs */
size_t tiny_max_len; /* Max. length of tiny objects */
hbool_t tiny_len_extended; /* Do tiny objects use two bytes for the length? */
- hbool_t huge_ids_direct; /* Are 'huge' objects directly acccessed? */
+ hbool_t huge_ids_direct; /* Are 'huge' objects directly accessed? */
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -7769,7 +7744,7 @@ test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
- const char *base_desc = "removing all objects from root direct block of absolute heap %s";
+ const char *base_desc = "removing all objects from root direct block of absolute heap";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -7842,7 +7817,7 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
- const char *base_desc = "removing all objects from two direct blocks of absolute heap %s";
+ const char *base_desc = "removing all objects from two direct blocks of absolute heap";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -7930,7 +7905,7 @@ test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
- const char *base_desc = "removing all objects from first row of direct blocks of absolute heap %s";
+ const char *base_desc = "removing all objects from first row of direct blocks of absolute heap";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -8000,7 +7975,7 @@ test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_par
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
- const char *base_desc = "removing all objects from first two rows of direct blocks of absolute heap %s";
+ const char *base_desc = "removing all objects from first two rows of direct blocks of absolute heap";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -8072,7 +8047,7 @@ test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
- const char *base_desc = "removing all objects from first four rows of direct blocks of absolute heap %s";
+ const char *base_desc = "removing all objects from first four rows of direct blocks of absolute heap";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -8148,7 +8123,7 @@ test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
- const char *base_desc = "removing all objects from all direct blocks of root group in absolute heap %s";
+ const char *base_desc = "removing all objects from all direct blocks of root group in absolute heap";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -8218,7 +8193,7 @@ test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
- const char *base_desc = "removing all objects from 2nd level indirect blocks of absolute heap %s";
+ const char *base_desc = "removing all objects from 2nd level indirect blocks of absolute heap";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -8292,7 +8267,7 @@ test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
- const char *base_desc = "removing all objects from 3rd level indirect blocks of absolute heap %s";
+ const char *base_desc = "removing all objects from 3rd level indirect blocks of absolute heap";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -8373,8 +8348,7 @@ test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
size_t obj_size; /* Size of object */
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
- const char *base_desc =
- "inserting object that is too large for starting block, then remove all objects %s";
+ const char *base_desc = "inserting object that is too large for starting block, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -8453,7 +8427,7 @@ test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
const char *base_desc =
- "skipping starting block, then adding object back to first block, then remove all objects %s";
+ "skipping starting block, then adding object back to first block, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -8553,7 +8527,7 @@ test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_t
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
const char *base_desc =
- "skipping starting block, then adding objects to backfill and extend, then remove all objects %s";
+ "skipping starting block, then adding objects to backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -8662,7 +8636,7 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
const char *base_desc = "insert object to initial block, then add object too large for starting direct "
- "blocks, then remove all objects %s";
+ "blocks, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -8761,7 +8735,7 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes
unsigned v; /* Local index variables */
/* Test description */
const char *base_desc = "insert object to initial block, then add object too large for starting direct "
- "blocks, then backfill and extend, then remove all objects %s";
+ "blocks, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -8907,7 +8881,7 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *
unsigned u; /* Local index variable */
/* Test description */
const char *base_desc =
- "skipping blocks with indirect root, then backfill and extend, then remove all objects %s";
+ "skipping blocks with indirect root, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -9072,7 +9046,7 @@ test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
const char *base_desc =
- "filling first row, then skipping rows, then backfill and extend, then remove all objects %s";
+ "filling first row, then skipping rows, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -9202,7 +9176,7 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_
unsigned v; /* Local index variables */
/* Test description */
const char *base_desc = "skipping direct blocks to last row and skipping two rows of root indirect "
- "block, then backfill and extend, then remove all objects %s";
+ "block, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -9328,7 +9302,7 @@ test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_crea
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
const char *base_desc = "filling direct blocks and skipping blocks in non-root indirect block, then "
- "backfill and extend, then remove all objects %s";
+ "backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -9457,7 +9431,7 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_
unsigned u; /* Local index variable */
/* Test description */
const char *base_desc = "filling direct blocks and skipping row of non-root indirect blocks, then "
- "backfill and extend, then remove all objects %s";
+ "backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -9589,7 +9563,7 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_
/* Test description */
const char *base_desc =
"filling direct blocks, filling 2nd level indirect blocks, except last one, and insert object too "
- "large for 2nd level indirect blocks, then backfill and extend, then remove all objects %s";
+ "large for 2nd level indirect blocks, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -9735,7 +9709,7 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5
unsigned u; /* Local index variable */
/* Test description */
const char *base_desc = "filling direct blocks and skipping row of non-root indirect blocks, then skip "
- "row of direct blocks, then backfill and extend, then remove all objects %s";
+ "row of direct blocks, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -9898,7 +9872,7 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_
unsigned u, v; /* Local index variables */
/* Test description */
const char *base_desc = "filling direct blocks and skipping two rows of root indirect block, then "
- "backfill and extend, then remove all objects %s";
+ "backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -10055,7 +10029,7 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t
/* Test description */
const char *base_desc =
"filling direct blocks and skipping two rows of root indirect block, skip one row of root indirect "
- "block, then backfill and extend, then remove all objects %s";
+ "block, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -10235,7 +10209,7 @@ test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t
/* Test description */
const char *base_desc =
"filling direct blocks, filling 2nd level indirect blocks, and skip first rows of direct blocks of "
- "3rd level indirect block, then backfill and extend, then remove all objects %s";
+ "3rd level indirect block, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -10367,7 +10341,7 @@ test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H
const char *base_desc =
"filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct "
"blocks, and skip first rows of direct blocks of 3rd level indirect block's 2nd level indirect "
- "block, then backfill and extend, then remove all objects %s";
+ "block, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -10511,7 +10485,7 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h
/* Test description */
const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level "
"indirect block's direct blocks, and skip first row of indirect blocks of 3rd "
- "level indirect block, then backfill and extend, then remove all objects %s";
+ "level indirect block, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -10664,7 +10638,7 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped(
/* Test description */
const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level "
"indirect block's direct blocks, and skip first two rows of indirect blocks of "
- "3rd level indirect block, then backfill and extend, then remove all objects %s";
+ "3rd level indirect block, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -10822,7 +10796,7 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t
const char *base_desc =
"filling direct blocks, filling 2nd level indirect blocks, filling first row of 3rd level indirect "
"blocks, except last one, fill all direct blocks in last 3rd level indirect block, and insert object "
- "too large for it's 2nd level indirect blocks, then backfill and extend, then remove all objects %s";
+ "too large for it's 2nd level indirect blocks, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -10986,7 +10960,7 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s
"filling direct blocks, filling 2nd level indirect blocks, filling first row of 3rd level indirect "
"blocks, fill all direct blocks in next 3rd level indirect block, fill all 1st row of 2nd level "
"indirect blocks, except last one, and insert object too large for 2nd level indirect block, then "
- "backfill and extend, then remove all objects %s";
+ "backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -11154,7 +11128,7 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5
const char *base_desc =
"filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill "
"4th level indirect block's direct blocks, and skip first row of 2nd indirect blocks of 4th level "
- "indirect block, then backfill and extend, then remove all objects %s";
+ "indirect block, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -11318,7 +11292,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo
"filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill "
"4th level indirect block's direct, 2nd level indirect blocks and 3rd level direct block, and skip "
"first row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then "
- "backfill and extend, then remove all objects %s";
+ "backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -11502,7 +11476,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_
"first row of 4th level indirect blocks, fill 2nd row 4th level indirect block's direct, 2nd level "
"indirect blocks, first row of 3rd level indirect blocks, 3rd level direct block in 2nd row, and "
"skip first row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then "
- "backfill and extend, then remove all objects %s";
+ "backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -11721,7 +11695,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star
"filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill "
"first row of 3rd level indirect blocks in 4th level indirect block except last 3rd level block, "
"fill direct blocks in 3rd level block, and skip row of 2nd indirect blocks of 4th level indirect "
- "block's 3rd level indirect block, then backfill and extend, then remove all objects %s";
+ "block's 3rd level indirect block, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -11922,7 +11896,7 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_
"first row of 4th level indirect blocks, except last one, fill first row of 3rd level indirect "
"blocks in last 4th level indirect block except last 3rd level block, fill direct blocks in 3rd "
"level block, and skip row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect "
- "block, then backfill and extend, then remove all objects %s";
+ "block, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -12143,7 +12117,7 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
fheap_heap_state_t state; /* State of fractal heap */
unsigned u; /* Local index variables */
/* Test description */
- const char *base_desc = "fragmenting small blocks, then backfill and extend, then remove all objects %s";
+ const char *base_desc = "fragmenting small blocks, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -12275,7 +12249,7 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
fheap_heap_state_t state; /* State of fractal heap */
unsigned u, v; /* Local index variables */
/* Test description */
- const char *base_desc = "fragmenting direct blocks, then backfill and extend, then remove all objects %s";
+ const char *base_desc = "fragmenting direct blocks, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -12449,7 +12423,7 @@ test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
unsigned u, v; /* Local index variables */
/* Test description */
const char *base_desc = "fill root direct blocks, then fragment 2nd level indirect block's direct "
- "blocks, then backfill and extend, then remove all objects %s";
+ "blocks, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -12561,7 +12535,7 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
/* Test description */
const char *base_desc =
"fill root direct blocks and 2nd level indirect blocks, then fragment 3rd level indirect block's "
- "direct blocks, then backfill and extend, then remove all objects %s";
+ "direct blocks, then backfill and extend, then remove all objects";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -12675,7 +12649,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
- const char *base_desc = "insert one huge object, then remove %s";
+ const char *base_desc = "insert one huge object, then remove";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -12826,7 +12800,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
- const char *base_desc = "insert two huge objects, then remove %s";
+ const char *base_desc = "insert two huge objects, then remove";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -13057,7 +13031,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
- const char *base_desc = "insert three huge objects, then remove %s";
+ const char *base_desc = "insert three huge objects, then remove";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -13364,7 +13338,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
- const char *base_desc = "insert mix of normal & huge objects, then remove %s";
+ const char *base_desc = "insert mix of normal & huge objects, then remove";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -13785,10 +13759,10 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
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 */
- hbool_t huge_ids_direct; /* Are 'huge' objects directly acccessed? */
+ hbool_t huge_ids_direct; /* Are 'huge' objects directly accessed? */
hbool_t pline_init = FALSE; /* Whether the I/O pipeline has been initialized */
/* Test description */
- const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove %s";
+ const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove";
/* Copy heap creation properties */
HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t));
@@ -13996,7 +13970,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
- const char *base_desc = "insert one tiny object, then remove %s";
+ const char *base_desc = "insert one tiny object, then remove";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -14147,7 +14121,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
- const char *base_desc = "insert two tiny objects, then remove %s";
+ const char *base_desc = "insert two tiny objects, then remove";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -14383,7 +14357,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
/* Test description */
- const char *base_desc = "insert mix of normal, huge & tiny objects, then remove %s";
+ const char *base_desc = "insert mix of normal, huge & tiny objects, then remove";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -14984,7 +14958,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
fheap_heap_state_t state; /* State of fractal heap */
unsigned deflate_level; /* Deflation level */
/* Test description */
- const char *base_desc = "insert one 'managed' object into heap with I/O filters, then remove %s";
+ const char *base_desc = "insert one 'managed' object into heap with I/O filters, then remove";
/* Copy heap creation properties */
HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t));
@@ -15158,7 +15132,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
fheap_heap_state_t state; /* State of fractal heap */
unsigned deflate_level; /* Deflation level */
/* Test description */
- const char *base_desc = "insert two 'managed' objects into heap with I/O filters, then remove %s";
+ const char *base_desc = "insert two 'managed' objects into heap with I/O filters, then remove";
/* Copy heap creation properties */
HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t));
@@ -16361,15 +16335,15 @@ main(void)
unsigned num_pb_fs = 1; /* The number of settings to test for page buffering and file space handling */
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 contig_addr_vfd; /* Whether VFD used has a contiguous 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");
+ envval = HDgetenv(HDF5_DRIVER);
if (envval == NULL)
envval = "nomatch";
- /* Current VFD that does not support contigous address space */
+ /* Current VFD that does not support contiguous address space */
contig_addr_vfd = (hbool_t)(HDstrcmp(envval, "split") != 0 && HDstrcmp(envval, "multi") != 0);
/* Reset library */
diff --git a/test/file_image.c b/test/file_image.c
index 0d031f5..7f6a83e 100644
--- a/test/file_image.c
+++ b/test/file_image.c
@@ -145,7 +145,7 @@ test_properties(void)
/* 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(temp2 != NULL, "Recieved buffer not set");
+ VERIFY(temp2 != NULL, "Received 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");
VERIFY(0 == HDmemcmp(temp2, buffer, size), "Buffers contain different data");
@@ -260,7 +260,7 @@ free_cb(void *ptr, H5FD_file_image_op_t op, void *udata)
* Function: udata_copy_cb
*
* Purpose: This function allows calls to the udata_copy callback to be tracked.
- * No copying actualy takes place; it is easier to deal with only one
+ * No copying actually takes place; it is easier to deal with only one
* instance of the udata.
*
* Returns: A pointer to the same udata that was passed in.
@@ -954,7 +954,7 @@ test_get_file_image(const char *test_banner, const int file_name_num, hid_t fapl
err = H5Fclose(core_file_id);
VERIFY(err == SUCCEED, "H5Fclose(core_file_id) failed.");
- /* dicard core fapl */
+ /* discard core fapl */
err = H5Pclose(core_fapl_id);
VERIFY(err == SUCCEED, "H5Pclose(core_fapl_id) failed.");
@@ -1078,7 +1078,7 @@ test_get_file_image_error_rejection(void)
VERIFY(bytes_read < 0, "H5Fget_file_image(2 -- test 1) succeeded.");
/* Call H5Fget_file_image() with good buffer and buffer size,
- * but non-existant file_id. Should fail.
+ * but non-existent file_id. Should fail.
*/
H5E_BEGIN_TRY
{
@@ -1361,7 +1361,10 @@ main(void)
errors += test_properties();
errors += test_callbacks();
- errors += test_core();
+
+ if (!h5_driver_uses_modified_filename()) {
+ errors += test_core();
+ }
/* Perform tests with/without user block */
for (user = FALSE; user <= TRUE; user++) {
diff --git a/test/filenotclosed.c b/test/filenotclosed.c
index b5def9b..58edc06 100644
--- a/test/filenotclosed.c
+++ b/test/filenotclosed.c
@@ -68,7 +68,7 @@ main(void)
hbool_t contig_addr_vfd; /* Contiguous address vfd */
/* Get the VFD to use */
- env_h5_drvr = HDgetenv("HDF5_DRIVER");
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
if (env_h5_drvr == NULL)
env_h5_drvr = "nomatch";
diff --git a/test/fillval.c b/test/fillval.c
index 8de6ef1..1a0c02f 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -1918,7 +1918,7 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, const hsize_t
if ((fspace = H5Dget_space(dset)) < 0)
TEST_ERROR
- /* Create dataspace for single element sized bufer */
+ /* Create dataspace for single element sized buffer */
if ((mspace = H5Screate_simple(5, one, NULL)) < 0)
TEST_ERROR
@@ -2142,7 +2142,7 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
#if 1
/*
- * Remove this when contiguous datasets can be exended to some
+ * Remove this when contiguous datasets can be extended to some
* predetermined fininte size, even if it's just in the slowest varying
* dimension. If it's removed prematurely then you'll get one of the
* errors described above or `unable to select fill value region'.
@@ -2722,7 +2722,10 @@ main(int argc, char *argv[])
nerrors += test_create(my_fapl, FILENAME[1], H5D_CONTIGUOUS);
nerrors += test_rdwr(my_fapl, FILENAME[3], H5D_CONTIGUOUS);
nerrors += test_extend(my_fapl, FILENAME[5], H5D_CONTIGUOUS);
- nerrors += test_compatible();
+
+ if (!h5_driver_uses_modified_filename()) {
+ nerrors += test_compatible();
+ }
} /* end if */
/* Compact dataset storage tests */
diff --git a/test/filter_fail.c b/test/filter_fail.c
index a1bcf28..64cc41a 100644
--- a/test/filter_fail.c
+++ b/test/filter_fail.c
@@ -160,7 +160,7 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled)
points[i] = i;
/* Write data. If the chunk cache is enabled, H5Dwrite should succeed. If it is
- * diabled, H5Dwrite should fail. */
+ * disabled, H5Dwrite should fail. */
if (cache_enabled) {
if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, points) < 0)
TEST_ERROR
@@ -186,7 +186,7 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled)
TEST_ERROR
/* Close dataset. If the chunk cache is enabled, the flushing of chunks should fail
- * during H5Dclose. If it is diabled, H5Dwrite should fail but H5Dclose should succeed. */
+ * during H5Dclose. If it is disabled, H5Dwrite should fail but H5Dclose should succeed. */
if (cache_enabled) {
H5E_BEGIN_TRY
{
diff --git a/test/filter_plugin1_dsets.c b/test/filter_plugin1_dsets.c
index 5d6c1ef..29b6e73 100644
--- a/test/filter_plugin1_dsets.c
+++ b/test/filter_plugin1_dsets.c
@@ -79,7 +79,7 @@ add_sub_value(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_value
value = (int)cd_values[0];
if (flags & H5Z_FLAG_REVERSE) {
- /* READ - Substract the given value from all the data values */
+ /* READ - Subtract the given value from all the data values */
while (buf_left > 0) {
*int_ptr++ -= value;
buf_left -= sizeof(int);
diff --git a/test/filter_plugin3_dsets.c b/test/filter_plugin3_dsets.c
index 618ce06..1d399e5 100644
--- a/test/filter_plugin3_dsets.c
+++ b/test/filter_plugin3_dsets.c
@@ -108,7 +108,7 @@ add_sub_value_hdf5(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_
value = (int)cd_values[0];
if (flags & H5Z_FLAG_REVERSE) {
- /* READ - Substract the given value from all the data values */
+ /* READ - Subtract the given value from all the data values */
while (buf_left > 0) {
*int_ptr++ -= value;
buf_left -= sizeof(int);
diff --git a/test/flush1.c b/test/flush1.c
index 456f5f4..0ddceb6 100644
--- a/test/flush1.c
+++ b/test/flush1.c
@@ -81,7 +81,7 @@ create_file(const char *filename, hid_t fapl_id, hbool_t swmr)
if ((top_gid = H5Gcreate2(fid, "top_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
STACK_ERROR
for (i = 0; i < NGROUPS; i++) {
- HDsprintf(group_name, "group%02d", i);
+ HDsnprintf(group_name, sizeof(group_name), "group%02d", i);
if ((gid = H5Gcreate2(top_gid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
STACK_ERROR
if (H5Gclose(gid) < 0)
@@ -201,7 +201,7 @@ main(void)
TEST_ERROR
/* Check if the current VFD supports SWMR */
- driver = HDgetenv("HDF5_DRIVER");
+ driver = HDgetenv(HDF5_DRIVER);
vfd_supports_swmr = H5FD__supports_swmr_test(driver);
/*************************************************/
diff --git a/test/flush2.c b/test/flush2.c
index 3262b14..b6c7761 100644
--- a/test/flush2.c
+++ b/test/flush2.c
@@ -144,7 +144,7 @@ file_ok(const char *filename, hid_t fapl_id, hbool_t check_second_dset)
if ((top_gid = H5Gopen2(fid, "top_group", H5P_DEFAULT)) < 0)
goto error;
for (i = 0; i < NGROUPS; i++) {
- HDsprintf(group_name, "group%02d", i);
+ HDsnprintf(group_name, sizeof(group_name), "group%02d", i);
if ((gid = H5Gopen2(top_gid, group_name, H5P_DEFAULT)) < 0)
goto error;
if (H5Gclose(gid) < 0)
@@ -251,7 +251,7 @@ main(void)
PUTS_ERROR("bad vfd-dependent fapl")
/* Check if the current VFD supports SWMR */
- driver = HDgetenv("HDF5_DRIVER");
+ driver = HDgetenv(HDF5_DRIVER);
vfd_supports_swmr = H5FD__supports_swmr_test(driver);
/* TEST 1 */
diff --git a/test/flushrefresh.c b/test/flushrefresh.c
index 5efff2f..0c10238 100644
--- a/test/flushrefresh.c
+++ b/test/flushrefresh.c
@@ -63,10 +63,10 @@
#define NOT_FLUSHED "NOT_FLUSHED"
/* Error Handling */
-/* For errors occuring in the main process, use the standard TEST_ERROR macro.
+/* For errors occurring in the main process, use the standard TEST_ERROR macro.
For errors occurring in the spawned process (from the test script), use
the PROCESS_ERROR macro, which will send a signal to the main process so the
- main process can propogate errors correctly. */
+ main process can propagate errors correctly. */
FILE *errorfile;
#define ERRFILE "flushrefresh_ERROR"
#define PROCESS_ERROR \
@@ -93,7 +93,7 @@ FILE *errorfile;
/* ===================== */
/* Main */
-int main(int argc, const char *argv[]);
+int main(int argc, char *argv[]);
/* Flush Test Framework */
herr_t test_flush(void);
@@ -137,7 +137,7 @@ herr_t end_verification(void);
*-------------------------------------------------------------------------
*/
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
/* Variables */
const char *envval = NULL;
@@ -153,7 +153,7 @@ main(int argc, const char *argv[])
* anything. */
/* Determine driver being used */
- envval = HDgetenv("HDF5_DRIVER");
+ envval = HDgetenv(HDF5_DRIVER);
if (envval == NULL || H5FD__supports_swmr_test(envval)) {
if (test_flush() != SUCCEED)
@@ -222,7 +222,7 @@ test_flush(void)
* 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
+ * if the object can be opened and its information retrieved 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).
@@ -695,7 +695,7 @@ test_refresh(void)
* 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 implementation 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:
*
@@ -1166,7 +1166,7 @@ error:
* Purpose: This function is used to communicate with the verification
* 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.
+ * on an object and conclude the refresh verification.
*
* Return: 0 on Success, 1 on Failure
*
@@ -1371,7 +1371,7 @@ error:
*
* Purpose: This function checks the status of external verification
* processes to see if they've succeeded. It checks for the
- * existance of flushrefresh_ERROR file. If present, that indicates
+ * existence 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
* failed, and this function succeeds.
diff --git a/test/freespace.c b/test/freespace.c
index e888b2b..1107609 100644
--- a/test/freespace.c
+++ b/test/freespace.c
@@ -661,13 +661,16 @@ test_fs_sect_add(hid_t fapl)
/* Close the file */
if (H5Fclose(file) < 0)
FAIL_STACK_ERROR
+ sect_node = NULL;
- /* Get the size of a file w/empty heap*/
- if ((tmp_file_size = h5_get_file_size(filename, fapl)) < 0)
- TEST_ERROR
+ if (h5_using_default_driver(NULL)) {
+ /* Get the size of a file w/empty heap*/
+ if ((tmp_file_size = h5_get_file_size(filename, fapl)) < 0)
+ TEST_ERROR
- if (tmp_file_size <= (file_size + fr_meta_size))
- TEST_ERROR
+ if (tmp_file_size <= (file_size + fr_meta_size))
+ TEST_ERROR
+ }
PASSED();
@@ -723,13 +726,16 @@ test_fs_sect_add(hid_t fapl)
/* Close the file */
if (H5Fclose(file) < 0)
FAIL_STACK_ERROR
+ sect_node = NULL;
- /* Get the size of a file w/empty heap*/
- if ((tmp_file_size = h5_get_file_size(filename, fapl)) < 0)
- TEST_ERROR
+ if (h5_using_default_driver(NULL)) {
+ /* Get the size of a file w/empty heap*/
+ if ((tmp_file_size = h5_get_file_size(filename, fapl)) < 0)
+ TEST_ERROR
- if (tmp_file_size != (file_size + fr_meta_size))
- TEST_ERROR
+ if (tmp_file_size != (file_size + fr_meta_size))
+ TEST_ERROR
+ }
PASSED();
@@ -799,6 +805,7 @@ test_fs_sect_add(hid_t fapl)
/* Close the file */
if (H5Fclose(file) < 0)
FAIL_STACK_ERROR
+ sect_node = NULL;
PASSED();
@@ -878,6 +885,7 @@ test_fs_sect_add(hid_t fapl)
/* Close the file */
if (H5Fclose(file) < 0)
FAIL_STACK_ERROR
+ sect_node = NULL;
PASSED();
diff --git a/test/gen_bounds.c b/test/gen_bounds.c
index 8148f16..87a9c18 100644
--- a/test/gen_bounds.c
+++ b/test/gen_bounds.c
@@ -858,12 +858,12 @@ gen_sel_files(const char *filename, H5F_libver_t low_bound, H5F_libver_t high_bo
if (H5Rcreate(&ref_wbuf[0], fid, DATASET, H5R_DATASET_REGION, sid) < 0)
TEST_ERROR;
- /* Create the reference datset */
+ /* Create the reference dataset */
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 */
+ /* Write to the reference dataset */
if (H5Dwrite(ref_did, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_wbuf) < 0)
TEST_ERROR;
@@ -886,12 +886,12 @@ gen_sel_files(const char *filename, H5F_libver_t low_bound, H5F_libver_t high_bo
if (H5Rcreate(&ref_wbuf[0], fid, DATASET, H5R_DATASET_REGION, sid) < 0)
TEST_ERROR;
- /* Create the reference datset */
+ /* Create the reference dataset */
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 */
+ /* Write to the reference dataset */
if (H5Dwrite(ref_did, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_wbuf) < 0)
TEST_ERROR;
@@ -915,12 +915,12 @@ gen_sel_files(const char *filename, H5F_libver_t low_bound, H5F_libver_t high_bo
if (H5Rcreate(&ref_wbuf[0], fid, DATASET, H5R_DATASET_REGION, sid) < 0)
TEST_ERROR;
- /* Create the reference datset */
+ /* Create the reference dataset */
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 */
+ /* Write to the reference dataset */
if (H5Dwrite(ref_did, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_wbuf) < 0)
TEST_ERROR;
diff --git a/test/gen_new_array.c b/test/gen_new_array.c
index 5811106..8161c4e 100644
--- a/test/gen_new_array.c
+++ b/test/gen_new_array.c
@@ -89,7 +89,7 @@ main(void)
if (ret < 0)
printf("field 1 insert<0!\n");
- /* Creat the array datatype */
+ /* Create the array datatype */
arr_type = H5Tarray_create2(H5T_NATIVE_FLOAT, ARRAY1_RANK, tdims1);
if (arr_type < 0)
printf("arr_type<0!\n");
@@ -104,7 +104,7 @@ main(void)
if (ret < 0)
printf("field 3 array close<0!\n");
- /* Creat the array datatype */
+ /* Create the array datatype */
arr_type = H5Tarray_create2(H5T_NATIVE_LONG, ARRAY1_RANK, tdims1);
if (arr_type < 0)
printf("arr_type<0!\n");
diff --git a/test/gen_old_group.c b/test/gen_old_group.c
index 1b4e0b2..15e67a4 100644
--- a/test/gen_old_group.c
+++ b/test/gen_old_group.c
@@ -19,7 +19,7 @@
* empty "symbol table" group.
*
* This file is used in the v1.7 branch (after the "compact group"
- * checkin) to test compatability. Compile and run this
+ * checkin) to test compatibility. Compile and run this
* program (with the 1.6.x branch), it will generate a file*
* called "group_old.h5". You need to move it to the test
* directory in the HDF5 v1.7 source tree. The test/stab.c
diff --git a/test/gen_plist.c b/test/gen_plist.c
index 10c6423..25d48cf 100644
--- a/test/gen_plist.c
+++ b/test/gen_plist.c
@@ -81,7 +81,7 @@ main(void)
H5AC_cache_image_config_t my_cache_image_config = {H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION, TRUE, FALSE,
-1};
- /* check endianess */
+ /* check endianness */
{
short int word = 0x0001;
char * byte = (char *)&word;
diff --git a/test/genall5.c b/test/genall5.c
index f1189fb..d7bef23 100644
--- a/test/genall5.c
+++ b/test/genall5.c
@@ -14,7 +14,7 @@
/* Programmer: John Mainzer
* 9/23/15
*
- * This file contains a heavily edited and functionaly reduce
+ * This file contains a heavily edited and functionally reduce
* version of the test code first written by Quincey in a file
* of the same name.
*/
diff --git a/test/getname.c b/test/getname.c
index 200c426..ba33280 100644
--- a/test/getname.c
+++ b/test/getname.c
@@ -1526,7 +1526,7 @@ test_main(hid_t file_id, hid_t fapl)
{
char name[NAME_BUF_SIZE]; /* Buffer to hold name and its size */
- /* Get name for non commited datatype, it should fail */
+ /* Get name for non committed datatype, it should fail */
H5E_BEGIN_TRY
{
if (H5Iget_name(type_id, name, NAME_BUF_SIZE) > 0)
@@ -3775,8 +3775,12 @@ main(void)
/* Call "main" test routine */
nerrors += test_main(file_id, fapl);
- nerrors += test_obj_ref(fapl);
- nerrors += test_reg_ref(fapl);
+
+ if (!h5_using_parallel_driver(NULL)) {
+ nerrors += test_obj_ref(fapl);
+ nerrors += test_reg_ref(fapl);
+ }
+
nerrors += test_elinks(fapl);
/* Close file */
diff --git a/test/gheap.c b/test/gheap.c
index 567fd65..f1182bd 100644
--- a/test/gheap.c
+++ b/test/gheap.c
@@ -353,7 +353,7 @@ error:
* 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
+ * and occasionally removing some. When we're done they're all
* removed.
*
* Return: Success: 0
diff --git a/test/h5test.c b/test/h5test.c
index 09fb5b5..0528623 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -40,10 +40,7 @@
* to the cpp constant. If neither is defined then use some default value.
*
* HDF5_DRIVER: This string describes what low level file driver to
- * 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_get_vfd_fapl() for details.
+ * use for HDF5 file access.
*
* HDF5_LIBVER_BOUNDS: This string describes what library version bounds to
* use for HDF5 file access. See h5_get_libver_fapl() for details.
@@ -525,8 +522,8 @@ 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)
{
- const char *prefix = NULL;
- const char *env = NULL; /* HDF5_DRIVER environment variable */
+ const char *prefix = NULL;
+ const char *driver_env_var = NULL; /* HDF5_DRIVER environment variable */
char * ptr, last = '\0';
const char *suffix = _suffix;
size_t i, j;
@@ -538,6 +535,13 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu
HDmemset(fullname, 0, size);
+ /* Determine if driver is set by environment variable. If it is,
+ * only generate a suffix if fixing the filename for the superblock
+ * file. */
+ driver_env_var = HDgetenv(HDF5_DRIVER);
+ if (driver_env_var && (H5P_DEFAULT == fapl) && subst_for_superblock)
+ fapl = H5P_FILE_ACCESS_DEFAULT;
+
/* figure out the suffix */
if (H5P_DEFAULT != fapl) {
if ((driver = H5Pget_driver(fapl)) < 0)
@@ -546,28 +550,25 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu
if (suffix) {
if (H5FD_FAMILY == driver) {
if (subst_for_superblock)
- suffix = "00000.h5";
+ suffix = "-000000.h5";
else
- suffix = nest_printf ? "%%05d.h5" : "%05d.h5";
+ suffix = nest_printf ? "-%%06d.h5" : "-%06d.h5";
}
else if (H5FD_MULTI == driver) {
- /* Get the environment variable, if it exists, in case
+ /* Check the HDF5_DRIVER environment variable 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;
+ if (!driver_env_var)
+ driver_env_var = HDF5_DRIVER;
#endif
- if (env && !HDstrcmp(env, "split")) {
+ if (driver_env_var && !HDstrcmp(driver_env_var, "split")) {
/* split VFD */
if (subst_for_superblock)
- suffix = "-m.h5";
- else
- suffix = NULL;
+ suffix = ".h5.meta";
}
else {
/* multi VFD */
@@ -583,7 +584,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu
/* 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) || driver_env_var) && (H5FD_MPIO == driver);
/* Check HDF5_NOCLEANUP environment setting.
* (The #ifdef is needed to prevent compile failure in case MPI is not
@@ -591,12 +592,12 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu
*/
if (isppdriver) {
#ifdef H5_HAVE_PARALLEL
- if (getenv_all(MPI_COMM_WORLD, 0, "HDF5_NOCLEANUP"))
+ if (getenv_all(MPI_COMM_WORLD, 0, HDF5_NOCLEANUP))
SetTestNoCleanup();
#endif /* H5_HAVE_PARALLEL */
}
else {
- if (HDgetenv("HDF5_NOCLEANUP"))
+ if (HDgetenv(HDF5_NOCLEANUP))
SetTestNoCleanup();
}
@@ -798,11 +799,7 @@ h5_fileaccess(void)
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
goto error;
- /* Attempt to set up a file driver first */
- if (h5_get_vfd_fapl(fapl_id) < 0)
- goto error;
-
- /* Finally, check for libver bounds */
+ /* Check for libver bounds */
if (h5_get_libver_fapl(fapl_id) < 0)
goto error;
@@ -837,11 +834,7 @@ h5_fileaccess_flags(unsigned flags)
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 */
+ /* Check for libver bounds */
if ((flags & H5_FILEACCESS_LIBVER) && h5_get_libver_fapl(fapl_id) < 0)
goto error;
@@ -854,150 +847,6 @@ error:
} /* end h5_fileaccess_flags() */
/*-------------------------------------------------------------------------
- * Function: h5_get_vfd_fapl
- *
- * Purpose: Sets the file driver for a FAPL according to the value specified
- * in the constant or environment variable "HDF5_DRIVER".
- *
- * Return: Success: 0
- * Failure: -1
- *
- * Programmer: Dana Robinson
- * February 2016
- *
- *-------------------------------------------------------------------------
- */
-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 */
-
- /* Get the environment variable, if it exists */
- env = HDgetenv("HDF5_DRIVER");
-#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
- * 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, "sec2")) {
- /* POSIX (section 2) read() and write() system calls */
- if (H5Pset_fapl_sec2(fapl) < 0)
- goto error;
- }
- else if (!HDstrcmp(tok, "stdio")) {
- /* Standard C fread() and fwrite() system calls */
- if (H5Pset_fapl_stdio(fapl) < 0)
- goto error;
- }
- else if (!HDstrcmp(tok, "core")) {
- /* In-memory driver settings (backing store on, 1 MB increment) */
- 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)H5_MB, TRUE) < 0)
- goto error;
- if (H5Pset_core_write_tracking(fapl, TRUE, (size_t)4096) < 0)
- 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)
- goto error;
- }
- else if (!HDstrcmp(tok, "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;
-
- 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));
-
- HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES);
- 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]);
- HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
- memb_name[mt] = sv[mt];
- memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10);
- } /* end for */
-
- if (H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, FALSE) < 0)
- goto error;
-
- 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 */
-
- /* Was a family size specified in the environment variable? */
- 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)
- 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_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)
- 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)
- goto error;
-#endif
- }
- else {
- /* Unknown driver */
- goto error;
- } /* end if */
-
-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
@@ -1333,30 +1182,58 @@ h5_get_file_size(const char *filename, hid_t fapl)
#ifdef H5_HAVE_DIRECT
driver == H5FD_DIRECT ||
#endif /* H5_HAVE_DIRECT */
- driver == H5FD_LOG) {
+ driver == H5FD_LOG || driver == H5FD_SPLITTER) {
/* Get the file's statistics */
if (0 == HDstat(filename, &sb))
return ((h5_stat_size_t)sb.st_size);
} /* end if */
else if (driver == H5FD_MULTI) {
H5FD_mem_t mt;
- h5_stat_size_t tot_size = 0;
-
- HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES);
- 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]);
-
- /* Check for existence of file */
- if (0 == HDaccess(temp, F_OK)) {
- /* Get the file's statistics */
- if (0 != HDstat(temp, &sb))
- return (-1);
-
- /* Add to total size */
- tot_size += (h5_stat_size_t)sb.st_size;
- } /* end if */
- } /* end for */
+ h5_stat_size_t tot_size = 0;
+ char * driver_env_var = NULL;
+
+ driver_env_var = HDgetenv(HDF5_DRIVER);
+ if (driver_env_var && !HDstrcmp(driver_env_var, "split")) {
+ for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) {
+ if (mt != H5FD_MEM_DRAW && mt != H5FD_MEM_SUPER)
+ continue;
+
+ /* Create the filename to query */
+ if (mt == H5FD_MEM_DRAW) {
+ HDsnprintf(temp, sizeof temp, "%s.raw", filename);
+ }
+ else {
+ HDsnprintf(temp, sizeof temp, "%s.meta", filename);
+ }
+
+ /* Check for existence of file */
+ if (0 == HDaccess(temp, F_OK)) {
+ /* Get the file's statistics */
+ if (0 != HDstat(temp, &sb))
+ return (-1);
+
+ /* Add to total size */
+ tot_size += (h5_stat_size_t)sb.st_size;
+ } /* end if */
+ } /* end for */
+ }
+ else {
+ HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES);
+ 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]);
+
+ /* Check for existence of file */
+ if (0 == HDaccess(temp, F_OK)) {
+ /* Get the file's statistics */
+ if (0 != HDstat(temp, &sb))
+ return (-1);
+
+ /* Add to total size */
+ tot_size += (h5_stat_size_t)sb.st_size;
+ } /* end if */
+ } /* end for */
+ }
/* Return total size */
return (tot_size);
@@ -1404,7 +1281,9 @@ h5_get_file_size(const char *filename, hid_t fapl)
return (tot_size);
} /* end if */
else {
- HDassert(0 && "Unknown VFD!");
+ /* Get the file's statistics */
+ if (0 == HDstat(filename, &sb))
+ return ((h5_stat_size_t)sb.st_size);
} /* end else */
} /* end else */
@@ -1786,7 +1665,7 @@ h5_send_message(const char *send, const char *arg1, const char *arg2)
* 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.,
+ * This function 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.
*
@@ -1892,7 +1771,9 @@ dummy_vfd_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hi
}
/* Dummy VFD with the minimum parameters to make a VFD that can be registered */
+#define DUMMY_VFD_VALUE (H5FD_class_value_t)155
static const H5FD_class_t H5FD_dummy_g = {
+ DUMMY_VFD_VALUE, /* value */
"dummy", /* name */
1, /* maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
@@ -1925,6 +1806,7 @@ static const H5FD_class_t H5FD_dummy_g = {
NULL, /* lock */
NULL, /* unlock */
NULL, /* del */
+ NULL, /* ctl */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -2287,3 +2169,137 @@ error:
}
return FAIL;
} /* end h5_check_if_file_locking_enabled() */
+
+/*-------------------------------------------------------------------------
+ * Function: h5_using_default_driver
+ *
+ * Purpose: Checks if the specified VFD name matches the library's
+ * default VFD. If `drv_name` is NULL, the HDF5_DRIVER
+ * environment is checked instead (if it is set).
+ *
+ * Return: TRUE/FALSE
+ *
+ *-------------------------------------------------------------------------
+ */
+hbool_t
+h5_using_default_driver(const char *drv_name)
+{
+ hbool_t ret_val = TRUE;
+
+ HDassert(H5_DEFAULT_VFD == H5FD_SEC2);
+
+ if (!drv_name)
+ drv_name = HDgetenv(HDF5_DRIVER);
+
+ if (drv_name)
+ return (!HDstrcmp(drv_name, "sec2") || !HDstrcmp(drv_name, "nomatch"));
+
+ return ret_val;
+}
+
+/*-------------------------------------------------------------------------
+ * Function: h5_using_parallel_driver
+ *
+ * Purpose: Checks if the specified VFD name matches a parallel-enabled
+ * VFD (usually `mpio`). If `drv_name` is NULL, the
+ * HDF5_DRIVER environment is checked instead (if it is set).
+ *
+ * This is mostly useful for avoiding tests that use features
+ * which are not currently supported for parallel HDF5, such
+ * as writing of VL or region reference datatypes.
+ *
+ * Return: TRUE/FALSE
+ *
+ *-------------------------------------------------------------------------
+ */
+hbool_t
+h5_using_parallel_driver(const char *drv_name)
+{
+ hbool_t ret_val = FALSE;
+
+ if (!drv_name)
+ drv_name = HDgetenv(HDF5_DRIVER);
+
+ if (drv_name)
+ return (!HDstrcmp(drv_name, "mpio"));
+
+ return ret_val;
+}
+
+/*-------------------------------------------------------------------------
+ * Function: h5_driver_uses_modified_filename
+ *
+ * Purpose: Checks if the current VFD set by use of the HDF5_DRIVER
+ * environment variable uses a modified filename. Examples
+ * are the multi and family drivers.
+ *
+ * This routine is helpful for skipping tests that use
+ * pre-generated files. VFDs that use a modified filename will
+ * not be able to find these files and those tests will fail.
+ * Eventually, HDF5's testing framework should be modified to
+ * not run VFD testing against tests that use pre-generated
+ * files.
+ *
+ * Return: TRUE/FALSE
+ *
+ *-------------------------------------------------------------------------
+ */
+hbool_t
+h5_driver_uses_modified_filename(void)
+{
+ hbool_t ret_val = FALSE;
+ char * driver = HDgetenv(HDF5_DRIVER);
+
+ if (driver) {
+ ret_val = !HDstrcmp(driver, "multi") || !HDstrcmp(driver, "split") || !HDstrcmp(driver, "family") ||
+ !HDstrcmp(driver, "splitter");
+ }
+
+ return ret_val;
+} /* end h5_driver_uses_modified_filename() */
+
+/*-------------------------------------------------------------------------
+ * Function: h5_driver_uses_multiple_files
+ *
+ * Purpose: Checks if the specified VFD name matches a driver that
+ * stores data using multiple files.
+ *
+ * The following flags can be used to control what types of
+ * drivers are checked for by this routine:
+ *
+ * H5_EXCLUDE_MULTIPART_DRIVERS - This flag excludes any
+ * drivers which store data using multiple files which,
+ * together, make up a single logical file. These are
+ * drivers like the split, multi and family drivers.
+ *
+ * H5_EXCLUDE_NON_MULTIPART_DRIVERS - This flag excludes any
+ * drivers which store data using multiple files which are
+ * separate logical files. The splitter driver is an example
+ * of this type of driver.
+ *
+ * Return: TRUE/FALSE
+ *
+ *-------------------------------------------------------------------------
+ */
+hbool_t
+h5_driver_uses_multiple_files(const char *drv_name, unsigned flags)
+{
+ hbool_t ret_val = FALSE;
+
+ if (!drv_name)
+ drv_name = HDgetenv(HDF5_DRIVER);
+
+ if (drv_name) {
+ if ((flags & H5_EXCLUDE_MULTIPART_DRIVERS) == 0) {
+ if (!HDstrcmp(drv_name, "split") || !HDstrcmp(drv_name, "multi") || !HDstrcmp(drv_name, "family"))
+ return TRUE;
+ }
+
+ if ((flags & H5_EXCLUDE_NON_MULTIPART_DRIVERS) == 0) {
+ if (!HDstrcmp(drv_name, "splitter"))
+ return TRUE;
+ }
+ }
+
+ return ret_val;
+}
diff --git a/test/h5test.h b/test/h5test.h
index 2855fb5..7b82b68 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -166,63 +166,25 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
#define H5_ALARM_SEC 1200 /* default is 20 minutes */
/* Flags for h5_fileaccess_flags() */
-#define H5_FILEACCESS_VFD 0x01
-#define H5_FILEACCESS_LIBVER 0x02
+#define H5_FILEACCESS_LIBVER 0x01
-/* 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)
+/* Flags for h5_driver_uses_multiple_files() */
+#define H5_EXCLUDE_MULTIPART_DRIVERS 0x01
+#define H5_EXCLUDE_NON_MULTIPART_DRIVERS 0x02
-#define H5TEST_FILL_2D_ARRAY(ARR, TYPE, DIMS_I, DIMS_J) \
+/* Fill an array on the heap with an increasing count value. BUF
+ * is expected to point to a `struct { TYPE arr[...][...]; }`.
+ */
+#define H5TEST_FILL_2D_HEAP_ARRAY(BUF, TYPE) \
do { \
/* Prefix with h5tfa to avoid shadow warnings */ \
- int h5tfa_i = 0; \
- int h5tfa_j = 0; \
- TYPE h5tfa_count = 0; \
+ size_t h5tfa_i = 0; \
+ size_t 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; \
+ for (h5tfa_i = 0; h5tfa_i < NELMTS((BUF)->arr); h5tfa_i++) \
+ for (h5tfa_j = 0; h5tfa_j < NELMTS((BUF)->arr[0]); h5tfa_j++) { \
+ (BUF)->arr[h5tfa_i][h5tfa_j] = h5tfa_count; \
h5tfa_count++; \
} \
} while (0)
@@ -255,9 +217,12 @@ H5TEST_DLL const char * h5_get_version_string(H5F_libver_t libver);
H5TEST_DLL int h5_compare_file_bytes(char *fname1, char *fname2);
H5TEST_DLL int h5_duplicate_file_by_bytes(const char *orig, const char *dest);
H5TEST_DLL herr_t h5_check_if_file_locking_enabled(hbool_t *are_enabled);
+H5TEST_DLL hbool_t h5_using_default_driver(const char *drv_name);
+H5TEST_DLL hbool_t h5_using_parallel_driver(const char *drv_name);
+H5TEST_DLL hbool_t h5_driver_uses_modified_filename(void);
+H5TEST_DLL hbool_t h5_driver_uses_multiple_files(const char *drv_name, unsigned flags);
/* 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 */
diff --git a/test/lheap.c b/test/lheap.c
index 2609510..283c3e3 100644
--- a/test/lheap.c
+++ b/test/lheap.c
@@ -174,27 +174,29 @@ main(void)
goto error;
PASSED();
- /* Check opening existing file non-default sizes of lengths and addresses */
- TESTING("opening pre-created file with non-default sizes");
- {
- const char *testfile = H5_get_srcdir_filename(TESTFILE); /* Corrected test file name */
- hid_t dset = -1;
- file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
- if (file >= 0) {
- if ((dset = H5Dopen2(file, "/Dataset1", H5P_DEFAULT)) < 0)
- TEST_ERROR
- if (H5Dclose(dset) < 0)
- TEST_ERROR
- if (H5Fclose(file) < 0)
- TEST_ERROR
+ if (!h5_driver_uses_modified_filename()) {
+ /* Check opening existing file non-default sizes of lengths and addresses */
+ TESTING("opening pre-created file with non-default sizes");
+ {
+ const char *testfile = H5_get_srcdir_filename(TESTFILE); /* Corrected test file name */
+ hid_t dset = -1;
+ file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
+ if (file >= 0) {
+ if ((dset = H5Dopen2(file, "/Dataset1", H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ if (H5Dclose(dset) < 0)
+ TEST_ERROR
+ if (H5Fclose(file) < 0)
+ TEST_ERROR
+ }
+ else {
+ H5_FAILED();
+ HDprintf("***cannot open the pre-created non-default sizes test file (%s)\n", testfile);
+ goto error;
+ } /* end else */
}
- else {
- H5_FAILED();
- HDprintf("***cannot open the pre-created non-default sizes test file (%s)\n", testfile);
- goto error;
- } /* end else */
+ PASSED();
}
- PASSED();
/* Verify symbol table messages are cached */
if (h5_verify_cached_stabs(FILENAME, fapl) < 0)
diff --git a/test/links.c b/test/links.c
index f022783..658f8d6 100644
--- a/test/links.c
+++ b/test/links.c
@@ -2144,6 +2144,7 @@ cklinks_deprec(hid_t fapl, hbool_t new_format)
char linkval[LINK_BUF_SIZE];
char filename[NAME_BUF_SIZE];
herr_t status;
+ htri_t exists;
if (new_format)
TESTING("link queries using deprecated routines (w/new group format)")
@@ -2183,20 +2184,20 @@ cklinks_deprec(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
H5E_BEGIN_TRY
{
- status = H5Lexists(file, "no_grp1/hard", H5P_DEFAULT);
+ exists = H5Lexists(file, "no_grp1/hard", H5P_DEFAULT);
}
H5E_END_TRY;
- if (status >= 0) {
+ if (exists >= 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);
+ exists = H5Lexists(file, "/no_grp1/hard", H5P_DEFAULT);
}
H5E_END_TRY;
- if (status >= 0) {
+ if (exists >= 0) {
H5_FAILED();
HDputs(" H5Lexists() should have failed for a path with missing components.");
TEST_ERROR
@@ -8201,7 +8202,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format)
if (status >= 0) {
H5_FAILED();
HDputs(
- " Retreiving name of object by index through dangling file external link should have failed.");
+ " Retrieving name of object by index through dangling file external link should have failed.");
} /* end if */
/* Close root group */
@@ -8674,7 +8675,7 @@ external_link_abstar(hid_t fapl, hbool_t new_format)
}
H5E_END_TRY;
- /* should be able to find the target file with abolute path */
+ /* should be able to find the target file with absolute path */
if (gid < 0) {
H5_FAILED();
HDputs(" Should have found the file in tmp_links directory.");
@@ -9897,7 +9898,7 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format)
would report FALSE, causing problems */
base_driver = H5Pget_driver(fapl);
op_data.base_fapl = (base_driver == H5FD_FAMILY || base_driver == H5FD_MULTI ||
- base_driver == H5FD_MPIO || base_driver == H5FD_CORE)
+ base_driver == H5FD_MPIO || base_driver == H5FD_CORE || base_driver == H5FD_DIRECT)
? H5P_DEFAULT
: fapl;
op_data.fam_size = ELINK_CB_FAM_SIZE;
@@ -10071,8 +10072,11 @@ external_reset_register(void)
if (H5Fclose(file) < 0)
TEST_ERROR
- if (HDremove(filename) != 0)
- TEST_ERROR
+ H5E_BEGIN_TRY
+ {
+ H5Fdelete(filename, H5P_DEFAULT);
+ }
+ H5E_END_TRY;
PASSED();
return SUCCEED;
@@ -16595,7 +16599,7 @@ link_filters(hid_t fapl, hbool_t new_format)
TEST_ERROR
filesize_unfiltered = h5_get_file_size(filename, fapl);
- /* Set deflate fitler */
+ /* Set deflate filter */
if (H5Pset_deflate(fcpl, 6) < 0)
TEST_ERROR
@@ -16629,11 +16633,14 @@ link_filters(hid_t fapl, hbool_t new_format)
/* Close file, get file size */
if (H5Fclose(fid) < 0)
TEST_ERROR
- 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 (h5_using_default_driver(NULL)) {
+ 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
+ }
/* Close */
if (H5Pclose(fcpl) < 0)
@@ -22544,8 +22551,9 @@ main(void)
unsigned minimize_dset_oh;
unsigned efc; /* Whether to use the external file cache */
const char *env_h5_drvr; /* File Driver value from environment */
+ hbool_t driver_uses_modified_filename = h5_driver_uses_modified_filename();
- env_h5_drvr = HDgetenv("HDF5_DRIVER");
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
if (env_h5_drvr == NULL)
env_h5_drvr = "nomatch";
@@ -22560,7 +22568,7 @@ main(void)
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");
+ HDprintf("\n-Testing with minimized dataset object headers-\n");
dcpl_g = H5Pcreate(H5P_DATASET_CREATE);
if (0 > dcpl_g)
TEST_ERROR
@@ -22611,88 +22619,100 @@ main(void)
nerrors += test_deprec(my_fapl, new_format);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
- /* 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;
+ /* Skip external link tests for splitter VFD, which has external link-related bugs */
+ if (HDstrcmp(env_h5_drvr, "splitter")) {
- /* 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;
+ /* 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;
- /* 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;
+ /* 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;
- /* 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 */
+ /* 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_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;
+ 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;
+ 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;
+ 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;
+ 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;
+ 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;
+
+ if (!driver_uses_modified_filename) {
+ 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;
+
+ if (!driver_uses_modified_filename) {
+ 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;
- } /* with/without external file cache */
+ 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
diff --git a/test/links_env.c b/test/links_env.c
index 590be20..7170132 100644
--- a/test/links_env.c
+++ b/test/links_env.c
@@ -152,8 +152,20 @@ error:
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 */
+ hid_t fapl; /* File access property lists */
+ int nerrors = 0; /* Error from tests */
+
+ /* Get the VFD to use */
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
+ if (env_h5_drvr == NULL)
+ env_h5_drvr = "nomatch";
+
+ /* Splitter VFD has issues with external links */
+ if (!HDstrcmp(env_h5_drvr, "splitter")) {
+ HDputs(" -- SKIPPED for incompatible VFD --");
+ HDexit(EXIT_SUCCESS);
+ }
h5_reset();
fapl = h5_fileaccess();
diff --git a/test/mf.c b/test/mf.c
index c753c2b..242e319 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -223,15 +223,16 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl)
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 */
+ hbool_t suitable_vfd;
TESTING("H5MM_alloc() of file allocation");
/* Skip test when using VFDs that has different address spaces for each
- * type of metadata allocation.
+ * type of metadata allocation. Also skip test for Direct VFD.
*/
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
- if (contig_addr_vfd) {
+ suitable_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "direct") != 0);
+ if (suitable_vfd) {
/* Set the filename to use for this test */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -371,15 +372,16 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
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 */
+ hbool_t suitable_vfd;
TESTING("H5MF_try_shrink() of file allocation: test 1");
/* Skip test when using VFDs that has different address spaces for each
- * type of metadata allocation.
+ * type of metadata allocation. Also skip test for Direct VFD.
*/
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
- if (contig_addr_vfd) {
+ suitable_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "direct") != 0);
+ if (suitable_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -478,9 +480,9 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_try_shrink() of file allocation: test 2");
/* Skip test when using VFDs that has different address spaces for each
- * type of metadata allocation.
+ * type of metadata allocation. Also skip test for Direct VFD.
*/
- if (contig_addr_vfd) {
+ if (suitable_vfd) {
/* Re-open the file with meta/small data setting */
if ((file = H5Fopen(filename, H5F_ACC_RDWR, fapl_new)) < 0)
FAIL_STACK_ERROR
@@ -528,9 +530,9 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_try_shrink() of file allocation: test 3");
/* Skip test when using VFDs that has different address spaces for each
- * type of metadata allocation.
+ * type of metadata allocation. Also skip test for Direct VFD.
*/
- if (contig_addr_vfd) {
+ if (suitable_vfd) {
/* Re-open the file with meta/small data setting */
if ((file = H5Fopen(filename, H5F_ACC_RDWR, fapl_new)) < 0)
FAIL_STACK_ERROR
@@ -573,9 +575,9 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_try_shrink() of file allocation: test 4");
/* Skip test when using VFDs that has different address spaces for each
- * type of metadata allocation.
+ * type of metadata allocation. Also skip test for Direct VFD.
*/
- if (contig_addr_vfd) {
+ if (suitable_vfd) {
/* Re-open the file with meta/small data setting */
if ((file = H5Fopen(filename, H5F_ACC_RDWR, fapl_new)) < 0)
FAIL_STACK_ERROR
@@ -658,15 +660,16 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
htri_t was_extended;
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 */
+ hbool_t suitable_vfd;
TESTING("H5MF_try_extend() of file allocation: test 1");
/* Skip test when using VFDs that has different address spaces for each
- * type of metadata allocation.
+ * type of metadata allocation. Also skip test for Direct VFD.
*/
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
- if (contig_addr_vfd) {
+ suitable_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "direct") != 0);
+ if (suitable_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -763,9 +766,9 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_try_extend() of file allocation: test 2");
/* Skip test when using VFDs that has different address spaces for each
- * type of metadata allocation.
+ * type of metadata allocation. Also skip test for Direct VFD.
*/
- if (contig_addr_vfd) {
+ if (suitable_vfd) {
/* Re-open the file with meta/small data setting */
if ((file = H5Fopen(filename, H5F_ACC_RDWR, fapl_new)) < 0)
FAIL_STACK_ERROR
@@ -1934,7 +1937,7 @@ test_mf_fs_extend(hid_t fapl)
if (check_stats(f, f->shared->fs_man[H5FD_MEM_SUPER], &state))
TEST_ERROR
- /* Remove section A from free-space manger */
+ /* Remove section A from free-space manager */
if (H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30 - 10), f->shared->fs_man[H5FD_MEM_SUPER],
&tmp) != TRUE)
TEST_ERROR
@@ -2012,7 +2015,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 contiguous address space */
TESTING("A free-space section absorbs an aggregator: test 1");
@@ -2188,13 +2191,14 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl)
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 */
+ hbool_t suitable_vfd;
TESTING("H5MF_alloc() of meta/sdata aggregator:test 1");
- /* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
- if (contig_addr_vfd) {
+ /* Skip test when using VFDs that don't use the metadata aggregator. Also skip test for Direct VFD. */
+ suitable_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "direct") != 0);
+ if (suitable_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -2339,13 +2343,14 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl)
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 */
+ hbool_t suitable_vfd;
TESTING("H5MF_alloc() of meta/sdata aggregator:test 2");
- /* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
- if (contig_addr_vfd) {
+ /* Skip test when using VFDs that don't use the metadata aggregator. Also skip test for Direct VFD. */
+ suitable_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "direct") != 0);
+ if (suitable_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -2497,7 +2502,7 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl)
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 */
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contiguous address space */
TESTING("H5MF_alloc() of meta/sdata aggregator: test 3");
@@ -2665,7 +2670,7 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl)
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 */
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contiguous address space */
TESTING("H5MF_alloc() of meta/sdata aggregator:test 4");
@@ -2814,7 +2819,7 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl)
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 */
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contiguous address space */
TESTING("H5MF_alloc() of meta/sdata aggregator:test 5");
@@ -2952,7 +2957,7 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl)
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 */
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contiguous address space */
TESTING("H5MF_alloc() of meta/sdata aggregator:test 6");
@@ -3126,7 +3131,7 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl)
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 */
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contiguous address space */
TESTING("H5MF_alloc() of meta/sdata aggregator:test 7");
@@ -3297,7 +3302,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
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 */
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contiguous address space */
TESTING("H5MF_try_extend() of meta/sdata aggregator: test 1");
@@ -3595,7 +3600,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
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 */
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contiguous address space */
TESTING("H5MF_try_shrink() of meta/sdata aggregator: test 1");
@@ -3847,16 +3852,17 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
htri_t was_extended;
H5FS_stat_t state;
hsize_t alignment = 0, mis_align = 0, tmp = 0, accum = 0;
- hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */
+ hbool_t suitable_vfd;
TESTING("H5MM_alloc() of file allocation with alignment: test 1");
/* Skip test when using VFDs that have their own 'alloc' callback, which
- * don't push mis-aligned space fragments on the file free space list
+ * don't push mis-aligned space fragments on the file free space list.
+ * Also skip test for Direct VFD.
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
- HDstrcmp(env_h5_drvr, "multi") != 0);
- if (have_alloc_vfd) {
+ suitable_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0 && HDstrcmp(env_h5_drvr, "direct") != 0);
+ if (suitable_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -3966,9 +3972,10 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TESTING("H5MF_try_shrink() of file allocation with alignment: test 2");
/* Skip test when using VFDs that have their own 'alloc' callback, which
- * don't push mis-aligned space fragments on the file free space list
+ * don't push mis-aligned space fragments on the file free space list.
+ * Also skip test for Direct VFD.
*/
- if (have_alloc_vfd) {
+ if (suitable_vfd) {
/* Re-open the file with alignment and meta/sdata setting */
if ((file = H5Fopen(filename, H5F_ACC_RDWR, fapl1)) < 0)
FAIL_STACK_ERROR
@@ -4023,9 +4030,10 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TESTING("H5MF_try_extend() of file allocation with alignment: test 3");
/* Skip test when using VFDs that have their own 'alloc' callback, which
- * don't push mis-aligned space fragments on the file free space list
+ * don't push mis-aligned space fragments on the file free space list.
+ * Also skip test for Direct VFD.
*/
- if (have_alloc_vfd) {
+ if (suitable_vfd) {
/* Re-open the file with alignment and meta/sdata setting */
if ((file = H5Fopen(filename, H5F_ACC_RDWR, fapl1)) < 0)
FAIL_STACK_ERROR
@@ -4080,6 +4088,9 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
HDputs(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
+ if (fapl1 >= 0 && H5Pclose(fapl1) < 0)
+ FAIL_STACK_ERROR
+
return (0);
error:
@@ -4135,7 +4146,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
H5FS_stat_t state;
htri_t was_extended;
hsize_t alignment = 0, tmp = 0, mis_align = 0;
- hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */
+ hbool_t suitable_vfd;
TESTING("H5MF_alloc() of free-space manager with alignment: test 1");
@@ -4297,10 +4308,11 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
+ * Also skip test for Direct VFD.
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
- HDstrcmp(env_h5_drvr, "multi") != 0);
- if (have_alloc_vfd) {
+ suitable_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0 && HDstrcmp(env_h5_drvr, "direct") != 0);
+ if (suitable_vfd) {
if ((file_size = h5_get_file_size(filename, new_fapl)) < 0)
TEST_ERROR
@@ -4497,16 +4509,17 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
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 */
+ hbool_t suitable_vfd;
TESTING("H5MF_alloc() of meta/sdata aggregator with alignment: test 1");
/* Skip test when using VFDs that have their own 'alloc' callback, which
- * don't push mis-aligned space fragments on the file free space list
+ * don't push mis-aligned space fragments on the file free space list.
+ * Also skip test for Direct VFD.
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
- HDstrcmp(env_h5_drvr, "multi") != 0);
- if (have_alloc_vfd) {
+ suitable_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0 && HDstrcmp(env_h5_drvr, "direct") != 0);
+ if (suitable_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -4759,16 +4772,17 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
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 */
+ hbool_t suitable_vfd;
TESTING("H5MF_alloc() of meta/sdata aggregator with alignment: test 2");
/* Skip test when using VFDs that have their own 'alloc' callback, which
- * don't push mis-aligned space fragments on the file free space list
+ * don't push mis-aligned space fragments on the file free space list.
+ * Also skip test for Direct VFD.
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
- HDstrcmp(env_h5_drvr, "multi") != 0);
- if (have_alloc_vfd) {
+ suitable_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0 && HDstrcmp(env_h5_drvr, "direct") != 0);
+ if (suitable_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -5104,16 +5118,17 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
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 */
+ hbool_t suitable_vfd;
TESTING("H5MF_alloc() of meta/sdata aggregator with alignment: test 3");
/* Skip test when using VFDs that have their own 'alloc' callback, which
- * don't push mis-aligned space fragments on the file free space list
+ * don't push mis-aligned space fragments on the file free space list.
+ * Also skip test for Direct VFD.
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
- HDstrcmp(env_h5_drvr, "multi") != 0);
- if (have_alloc_vfd) {
+ suitable_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0 && HDstrcmp(env_h5_drvr, "direct") != 0);
+ if (suitable_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -5417,16 +5432,17 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
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 */
+ hbool_t suitable_vfd;
TESTING("H5MF_alloc() of meta/sdata aggregator with alignment: test 4");
/* Skip test when using VFDs that have their own 'alloc' callback, which
- * don't push mis-aligned space fragments on the file free space list
+ * don't push mis-aligned space fragments on the file free space list.
+ * Also skip test for Direct VFD.
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
- HDstrcmp(env_h5_drvr, "multi") != 0);
- if (have_alloc_vfd) {
+ suitable_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0 && HDstrcmp(env_h5_drvr, "direct") != 0);
+ if (suitable_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -5635,16 +5651,17 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
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 */
+ hbool_t suitable_vfd;
TESTING("H5MF_alloc() of meta/sdata aggregator with alignment: test 5");
/* Skip test when using VFDs that have their own 'alloc' callback, which
- * don't push mis-aligned space fragments on the file free space list
+ * don't push mis-aligned space fragments on the file free space list.
+ * Also skip test for Direct VFD.
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
- HDstrcmp(env_h5_drvr, "multi") != 0);
- if (have_alloc_vfd) {
+ suitable_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0 && HDstrcmp(env_h5_drvr, "direct") != 0);
+ if (suitable_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -5838,7 +5855,7 @@ error:
*
* Alignment = 4096 aggr->alloc_size = 2048
*
- * Allocate first block (30) from meta_aggr: (meta_aggr is emtpy)
+ * 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
@@ -5905,16 +5922,17 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
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 */
+ hbool_t suitable_vfd;
TESTING("H5MF_alloc() of meta/sdata aggregator with alignment: test 6");
/* Skip test when using VFDs that have their own 'alloc' callback, which
- * don't push mis-aligned space fragments on the file free space list
+ * don't push mis-aligned space fragments on the file free space list.
+ * Also skip test for Direct VFD.
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
- HDstrcmp(env_h5_drvr, "multi") != 0);
- if (have_alloc_vfd) {
+ suitable_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0 && HDstrcmp(env_h5_drvr, "direct") != 0);
+ if (suitable_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -6139,20 +6157,23 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl)
/* Add alignment to member files for split/multi driver */
if (split || multi) {
- hid_t memb_fapl;
+ if (split) {
+ hid_t memb_fapl_arr[H5FD_MEM_NTYPES];
- /* Creat fapl */
- if ((memb_fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- TEST_ERROR
+ /* Get current multi settings */
+ if (H5Pget_fapl_multi(copied_fapl, NULL, memb_fapl_arr, NULL, NULL, NULL) < 0)
+ TEST_ERROR
- /* Set alignment. Note that it is the block size of the parent FAPL that
- * is important here. */
- if (H5Pset_alignment(memb_fapl, 0, align) < 0)
- TEST_ERROR
+ /* Set alignment. Note that it is the block size of the parent FAPL that
+ * is important here. */
+ if (H5Pset_alignment(memb_fapl_arr[H5FD_MEM_SUPER], 0, align) < 0)
+ TEST_ERROR
+ if (H5Pset_alignment(memb_fapl_arr[H5FD_MEM_DRAW], 0, align) < 0)
+ TEST_ERROR
- if (split) {
/* Set split driver with new FAPLs */
- if (H5Pset_fapl_split(copied_fapl, "-m.h5", memb_fapl, "-r.h5", memb_fapl) < 0)
+ if (H5Pset_fapl_split(copied_fapl, "-m.h5", memb_fapl_arr[H5FD_MEM_SUPER], "-r.h5",
+ memb_fapl_arr[H5FD_MEM_DRAW]) < 0)
TEST_ERROR
} /* end if */
else {
@@ -6165,14 +6186,17 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl)
/* Get current multi settings */
HDmemset(memb_name, 0, sizeof memb_name);
- if (H5Pget_fapl_multi(copied_fapl, memb_map, NULL, memb_name, memb_addr, &relax) < 0)
+ if (H5Pget_fapl_multi(copied_fapl, memb_map, memb_fapl_arr, memb_name, memb_addr, &relax) < 0)
TEST_ERROR
/* Populate memb_fapl_arr, patch memb_addr so member file addresses
* are aligned */
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;
+ /* Set alignment. Note that it is the block size of the parent FAPL that
+ * is important here. */
+ if (H5Pset_alignment(memb_fapl_arr[mt], 0, align) < 0)
+ TEST_ERROR
+ memb_addr[mt] = ((memb_addr[mt] + align - 1) / align) * align;
} /* end for */
/* Set multi driver with new FAPLs */
@@ -6184,11 +6208,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl)
for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++)
HDfree(memb_name[mt]);
} /* end else */
-
- /* Close memb_fapl */
- if (H5Pclose(memb_fapl) < 0)
- TEST_ERROR
- } /* end if */
+ } /* end if */
/* Reopen the file with alignment */
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, copied_fapl)) < 0)
@@ -6253,6 +6273,9 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl)
PASSED();
+ if (H5Pclose(copied_fapl) < 0)
+ TEST_ERROR
+
/* Close file */
if (H5Fclose(file) < 0)
TEST_ERROR
@@ -7105,7 +7128,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
else
TESTING("File's free-space is going away with old library format")
- /* Current VFD that does not support contigous address space */
+ /* Current VFD that does not support contiguous address space */
contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
@@ -7296,7 +7319,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for
else
TESTING("File space strategy/persisting/threshold with old library format")
- /* Current VFD that does not support contigous address space */
+ /* Current VFD that does not support contiguous address space */
contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
/* Set the filename to use for this test (dependent on fapl) */
@@ -7466,7 +7489,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format
else
TESTING("File space merge/shrink for section size < threshold with old library format")
- /* Current VFD that does not support contigous address space */
+ /* Current VFD that does not support contiguous address space */
contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
/* Set the filename to use for this test (dependent on fapl) */
@@ -7900,6 +7923,8 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
if (fs_persist) {
+ haddr_t prv_tag = HADDR_UNDEF;
+
/* Re-open the file */
if ((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl_new)) < 0)
TEST_ERROR
@@ -7908,6 +7933,9 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
if (NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR
+ /* Set the freespace tag for the metadata cache */
+ H5AC_tag(H5AC__FREESPACE_TAG, &prv_tag);
+
/* Verify that the large generic manager is there */
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]))
@@ -7963,6 +7991,9 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
if (found_addr != gaddr1)
TEST_ERROR
+ /* Reset the previous tag */
+ H5AC_tag(prv_tag, NULL);
+
/* Close file */
if (H5Fclose(fid) < 0)
TEST_ERROR
@@ -8016,7 +8047,7 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl)
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 */
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contiguous address space */
htri_t status; /* status from shrinking */
h5_stat_size_t file_size; /* File size */
char filename[FILENAME_LEN]; /* Filename to use */
@@ -8146,7 +8177,7 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
H5F_t * f = NULL; /* Internal file object pointer */
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 */
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contiguous address space */
htri_t was_extended; /* Whether the block can be extended or not */
char filename[FILENAME_LEN]; /* Filename to use */
@@ -8325,7 +8356,7 @@ test_page_large_try_extend(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 gaddr1, gaddr2, gaddr3, gaddr4; /* Addresses for large data blocks */
- hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contiguous address space */
htri_t was_extended; /* Whether the block can be extended or not */
char filename[FILENAME_LEN]; /* Filename to use */
@@ -8488,7 +8519,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl)
hid_t fcpl = -1; /* File creation property list ID */
H5F_t * f = NULL; /* Internal file object pointer */
haddr_t gaddr1, gaddr2, gaddr3, gaddr4; /* Addresses for blocks */
- hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contiguous address space */
H5FS_stat_t fs_stat; /* Information for free-space manager */
h5_stat_size_t file_size; /* File size */
char filename[FILENAME_LEN]; /* Filename to use */
@@ -9120,7 +9151,7 @@ main(void)
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
/* Get the VFD to use */
- env_h5_drvr = HDgetenv("HDF5_DRIVER");
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
if (env_h5_drvr == NULL)
env_h5_drvr = "nomatch";
diff --git a/test/mirror_vfd.c b/test/mirror_vfd.c
index 3fa2cdc..d741519 100644
--- a/test/mirror_vfd.c
+++ b/test/mirror_vfd.c
@@ -130,7 +130,7 @@ mybzero(void *dest, size_t size)
* 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.
+ * run h5fixname() to get the "actual" path to the intended 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()
diff --git a/test/mount.c b/test/mount.c
index c5ac9b3..b23de30 100644
--- a/test/mount.c
+++ b/test/mount.c
@@ -753,7 +753,7 @@ test_move(hid_t fapl)
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
- HDputs(" Moving an object across files should't have been possible");
+ HDputs(" Moving an object across files shouldn't have been possible");
TEST_ERROR
} /* end if */
@@ -1835,7 +1835,7 @@ test_mount_after_unmount(hid_t fapl)
if (HDstrcmp(objname, "/X/M/Y") != 0)
TEST_ERROR
- /* Rename object in file #3 that is "disconnected" from name hiearchy */
+ /* Rename object in file #3 that is "disconnected" from name hierarchy */
/* (It is "disconnected" because it's parent file has been unmounted) */
if (H5Lmove(gidAMX, "M/Y", gidAMX, "M/Z", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR
diff --git a/test/mtime.c b/test/mtime.c
index 43dc502..8e89d58 100644
--- a/test/mtime.c
+++ b/test/mtime.c
@@ -60,6 +60,7 @@ main(void)
signed char buf1[32], buf2[32];
char filename[1024];
int token_cmp;
+ hbool_t driver_uses_modified_filename = h5_driver_uses_modified_filename();
h5_reset();
fapl = h5_fileaccess();
@@ -116,7 +117,7 @@ main(void)
if (0 == oi1.ctime) {
SKIPPED();
HDputs(" The modification time could not be decoded on this OS.");
- HDputs(" Modification times will be mantained in the file but");
+ HDputs(" Modification times will be maintained in the file but");
HDputs(" cannot be queried on this system. See H5O_mtime_decode().");
return 0;
}
@@ -131,63 +132,67 @@ main(void)
}
PASSED();
- /* Check opening existing file with old-style modification time information
- * and make certain that the time is correct
- */
- TESTING("accessing old modification time messages");
-
- {
- const char *testfile = H5_get_srcdir_filename(TESTFILE1); /* Corrected test file name */
-
- file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
- if (file >= 0) {
- if (H5Oget_info_by_name3(file, "/Dataset1", &oi1, H5O_INFO_TIME, H5P_DEFAULT) < 0)
- TEST_ERROR;
- if (oi1.ctime != MTIME1) {
+ if (!driver_uses_modified_filename) {
+ /* Check opening existing file with old-style modification time information
+ * and make certain that the time is correct
+ */
+ TESTING("accessing old modification time messages");
+
+ {
+ const char *testfile = H5_get_srcdir_filename(TESTFILE1); /* Corrected test file name */
+
+ file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
+ if (file >= 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 dependent (e.g., on Windows DST must be hardcoded). */
+ HDputs(" Old modification time incorrect");
+ goto error;
+ }
+ if (H5Fclose(file) < 0)
+ TEST_ERROR;
+ }
+ else {
H5_FAILED();
- /* If this fails, examine H5Omtime.c. Modification time is very
- * system dependent (e.g., on Windows DST must be hardcoded). */
- HDputs(" Old modification time incorrect");
+ HDprintf("***cannot open the pre-created old modification test file (%s)\n", testfile);
goto error;
- }
- if (H5Fclose(file) < 0)
- TEST_ERROR;
+ } /* end else */
}
- else {
- H5_FAILED();
- HDprintf("***cannot open the pre-created old modification test file (%s)\n", testfile);
- goto error;
- } /* end else */
+ PASSED();
}
- PASSED();
- /* Check opening existing file with new-style modification time information
- * and make certain that the time is correct
- */
- TESTING("accessing new modification time messages");
-
- {
- const char *testfile = H5_get_srcdir_filename(TESTFILE2); /* Corrected test file name */
-
- file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
- if (file >= 0) {
- if (H5Oget_info_by_name3(file, "/Dataset1", &oi2, H5O_INFO_TIME, H5P_DEFAULT) < 0)
- TEST_ERROR;
- if (oi2.ctime != MTIME2) {
+ if (!driver_uses_modified_filename) {
+ /* Check opening existing file with new-style modification time information
+ * and make certain that the time is correct
+ */
+ TESTING("accessing new modification time messages");
+
+ {
+ const char *testfile = H5_get_srcdir_filename(TESTFILE2); /* Corrected test file name */
+
+ file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
+ if (file >= 0) {
+ if (H5Oget_info_by_name3(file, "/Dataset1", &oi2, H5O_INFO_TIME, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+ if (oi2.ctime != MTIME2) {
+ H5_FAILED();
+ HDputs(" Modification time incorrect.");
+ goto error;
+ }
+ if (H5Fclose(file) < 0)
+ TEST_ERROR;
+ }
+ else {
H5_FAILED();
- HDputs(" Modification time incorrect.");
+ HDprintf("***cannot open the pre-created old modification test file (%s)\n", testfile);
goto error;
- }
- if (H5Fclose(file) < 0)
- TEST_ERROR;
+ } /* end else */
}
- else {
- H5_FAILED();
- HDprintf("***cannot open the pre-created old modification test file (%s)\n", testfile);
- goto error;
- } /* end else */
+ PASSED();
}
- PASSED();
/* Verify symbol table messages are cached */
if (h5_verify_cached_stabs(FILENAME, fapl) < 0)
diff --git a/test/ntypes.c b/test/ntypes.c
index 13cc72a..37a63a4 100644
--- a/test/ntypes.c
+++ b/test/ntypes.c
@@ -3131,11 +3131,19 @@ main(void)
nerrors += test_enum_dtype(file) < 0 ? 1 : 0;
nerrors += test_array_dtype(file) < 0 ? 1 : 0;
nerrors += test_array_dtype2(file) < 0 ? 1 : 0;
- nerrors += test_vl_dtype(file) < 0 ? 1 : 0;
- nerrors += test_vlstr_dtype(file) < 0 ? 1 : 0;
+
+ if (!h5_using_parallel_driver(NULL)) {
+ nerrors += test_vl_dtype(file) < 0 ? 1 : 0;
+ nerrors += test_vlstr_dtype(file) < 0 ? 1 : 0;
+ }
+
nerrors += test_str_dtype(file) < 0 ? 1 : 0;
- nerrors += test_refer_dtype(file) < 0 ? 1 : 0;
- nerrors += test_refer_dtype2(file) < 0 ? 1 : 0;
+
+ if (!h5_using_parallel_driver(NULL)) {
+ nerrors += test_refer_dtype(file) < 0 ? 1 : 0;
+ nerrors += test_refer_dtype2(file) < 0 ? 1 : 0;
+ }
+
nerrors += test_opaque_dtype(file) < 0 ? 1 : 0;
nerrors += test_bitfield_dtype(file) < 0 ? 1 : 0;
nerrors += test_ninteger() < 0 ? 1 : 0;
diff --git a/test/null_vfd_plugin.c b/test/null_vfd_plugin.c
new file mode 100644
index 0000000..f41da00
--- /dev/null
+++ b/test/null_vfd_plugin.c
@@ -0,0 +1,162 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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://www.hdfgroup.org/licenses. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* Purpose: A simple Virtual File Driver (VFD) with almost no functionality
+ * that is used for testing basic VFD plugin handling (registration, etc.).
+ */
+
+/* Public HDF5 headers */
+#include "hdf5.h"
+
+/* For HDF5 plugin functionality */
+#include "H5PLextern.h"
+
+/* This driver's header */
+#include "null_vfd_plugin.h"
+
+/* Prototypes */
+static H5FD_t *H5FD_null_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
+static herr_t H5FD_null_close(H5FD_t *_file);
+static herr_t H5FD_null_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
+ void *buf);
+static herr_t H5FD_null_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
+ const void *buf);
+static haddr_t H5FD_null_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD_null_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
+static haddr_t H5FD_null_get_eof(const H5FD_t *_file, H5FD_mem_t type);
+
+static const H5FD_class_t H5FD_null_g = {
+ NULL_VFD_VALUE, /* value */
+ NULL_VFD_NAME, /* 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 */
+ H5FD_null_open, /* open */
+ H5FD_null_close, /* close */
+ NULL, /* cmp */
+ NULL, /* query */
+ NULL, /* get_type_map */
+ NULL, /* alloc */
+ NULL, /* free */
+ H5FD_null_get_eoa, /* get_eoa */
+ H5FD_null_set_eoa, /* set_eoa */
+ H5FD_null_get_eof, /* get_eof */
+ NULL, /* get_handle */
+ H5FD_null_read, /* read */
+ H5FD_null_write, /* write */
+ NULL, /* flush */
+ NULL, /* truncate */
+ NULL, /* lock */
+ NULL, /* unlock */
+ NULL, /* del */
+ NULL, /* ctl */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
+};
+
+static H5FD_t *
+H5FD_null_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
+{
+ (void)name;
+ (void)flags;
+ (void)fapl_id;
+ (void)maxaddr;
+
+ return NULL;
+}
+
+static herr_t
+H5FD_null_close(H5FD_t *_file)
+{
+ (void)_file;
+
+ return 0;
+}
+
+static herr_t
+H5FD_null_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf)
+{
+ (void)_file;
+ (void)type;
+ (void)dxpl_id;
+ (void)addr;
+ (void)size;
+ (void)buf;
+
+ return 0;
+}
+
+static herr_t
+H5FD_null_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf)
+{
+ (void)_file;
+ (void)type;
+ (void)dxpl_id;
+ (void)addr;
+ (void)size;
+ (void)buf;
+
+ return 0;
+}
+
+static haddr_t
+H5FD_null_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
+{
+ (void)_file;
+ (void)type;
+
+ return HADDR_UNDEF;
+}
+
+static herr_t
+H5FD_null_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
+{
+ (void)_file;
+ (void)type;
+ (void)addr;
+
+ return 0;
+}
+
+static haddr_t
+H5FD_null_get_eof(const H5FD_t *_file, H5FD_mem_t type)
+{
+ (void)_file;
+ (void)type;
+
+ return HADDR_UNDEF;
+}
+
+/* These two functions are necessary to load this plugin using
+ * the HDF5 library.
+ */
+
+H5PL_type_t
+H5PLget_plugin_type(void)
+{
+ return H5PL_TYPE_VFD;
+}
+
+const void *
+H5PLget_plugin_info(void)
+{
+ return &H5FD_null_g;
+}
diff --git a/test/null_vfd_plugin.h b/test/null_vfd_plugin.h
new file mode 100644
index 0000000..7b7671f
--- /dev/null
+++ b/test/null_vfd_plugin.h
@@ -0,0 +1,33 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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://www.hdfgroup.org/licenses. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: The public header file for the null testing VFD plugin.
+ */
+#ifndef H5FDnull_H
+#define H5FDnull_H
+
+#define H5FD_NULL (H5FD_null_init())
+#define NULL_VFD_NAME "null_vfd_plugin"
+#define NULL_VFD_VALUE ((H5FD_class_value_t)200)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+H5_DLL hid_t H5FD_null_init(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/test/objcopy.c b/test/objcopy.c
index 9aae621..e23ee8e 100644
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -2789,7 +2789,7 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
char dst_filename[NAME_BUF_SIZE];
if (test_open) {
- TESTING("H5Ocopy(): empty and openend contiguous dataset");
+ TESTING("H5Ocopy(): empty and opened contiguous dataset");
}
else {
TESTING("H5Ocopy(): empty contiguous dataset");
@@ -8679,7 +8679,7 @@ test_copy_soft_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fa
char dst_filename[NAME_BUF_SIZE];
if (test_open) {
- TESTING("H5Ocopy(): openend object through soft link");
+ TESTING("H5Ocopy(): opened object through soft link");
}
else {
TESTING("H5Ocopy(): object through soft link");
@@ -9674,7 +9674,7 @@ test_copy_dataset_contig_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
char src_filename[NAME_BUF_SIZE];
char dst_filename[NAME_BUF_SIZE];
- TESTING("H5Ocopy(): contigous dataset with named VLEN datatype");
+ TESTING("H5Ocopy(): contiguous dataset with named VLEN datatype");
/* set initial data values */
for (i = 0; i < DIM_SIZE_1; i++) {
@@ -10434,10 +10434,10 @@ test_copy_dataset_contig_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
char dst_filename[NAME_BUF_SIZE];
if (test_open) {
- TESTING("H5Ocopy(): contigous and opened dataset with nested VLEN datatype");
+ TESTING("H5Ocopy(): contiguous and opened dataset with nested VLEN datatype");
}
else {
- TESTING("H5Ocopy(): contigous dataset with nested VLEN datatype");
+ TESTING("H5Ocopy(): contiguous dataset with nested VLEN datatype");
}
/* set initial data values */
@@ -13763,7 +13763,7 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
TEST_ERROR
/*
- * Test 3: copy datsets in /g0 at SRC to DST group /uncopied
+ * Test 3: copy datasets in /g0 at SRC to DST group /uncopied
*/
if (H5Ocopy(fid_src, NAME_GROUP_TOP "/" SRC_DSET1, fid_dst, NAME_GROUP_UNCOPIED "/" SRC_DSET1, ocpypl_id,
H5P_DEFAULT) < 0)
@@ -17305,13 +17305,18 @@ error:
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;
- hbool_t same_file; /* Whether to run tests that only use one file */
+ int nerrors = 0;
+ hid_t fapl, fapl2;
+ hid_t fcpl_shared, ocpl;
+ unsigned max_compact, min_dense;
+ int configuration; /* Configuration of tests. */
+ int ExpressMode;
+ const char *env_h5_drvr; /* File Driver value from environment */
+ hbool_t same_file; /* Whether to run tests that only use one file */
+
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
+ if (env_h5_drvr == NULL)
+ env_h5_drvr = "nomatch";
/* Setup */
h5_reset();
@@ -17468,9 +17473,14 @@ 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");
- 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");
+
+ /* Splitter VFD currently has external link-related bugs */
+ if (HDstrcmp(env_h5_drvr, "splitter")) {
+ 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");
+ }
+
nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, H5O_COPY_SHALLOW_HIERARCHY_FLAG,
FALSE, "H5Ocopy(): shallow group copy");
nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, H5O_COPY_EXPAND_REFERENCE_FLAG,
@@ -17548,9 +17558,14 @@ main(void)
nerrors += test_copy_same_file_named_datatype(fcpl_src, src_fapl);
- /* Test with dataset opened in the file or not */
- nerrors += test_copy_old_layout(fcpl_dst, dst_fapl, FALSE);
- nerrors += test_copy_old_layout(fcpl_dst, dst_fapl, TRUE);
+ /* Check if current driver might modify the filename. Skip these tests
+ * if so, since the file is pre-generated.
+ */
+ if (!h5_driver_uses_modified_filename()) {
+ /* Test with dataset opened in the file or not */
+ nerrors += test_copy_old_layout(fcpl_dst, dst_fapl, FALSE);
+ nerrors += test_copy_old_layout(fcpl_dst, dst_fapl, TRUE);
+ }
/* Test with dataset opened in the file or not */
nerrors += test_copy_null_ref(fcpl_src, fcpl_dst, src_fapl, dst_fapl);
diff --git a/test/ohdr.c b/test/ohdr.c
index d28b11e..c7a13fa 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -34,6 +34,13 @@
#define H5G_FRIEND /* suppress error about including H5Gpkg */
#include "H5Gpkg.h"
+/*
+ * This file needs to access private routines from the H5FD package.
+ */
+#define H5FD_FRIEND /* suppress error about including H5FDpkg */
+#define H5FD_TESTING
+#include "H5FDpkg.h"
+
const char *FILENAME[] = {"ohdr", "ohdr_min_a", "ohdr_min_b", NULL};
/* used for object header size comparison */
@@ -584,7 +591,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
TESTING("object with unknown header message & 'shareable' flag set");
- /* Open the dataset with the unknown header message, adn "shareable" flag */
+ /* Open the dataset with the unknown header message, and "shareable" flag */
if ((did = H5Dopen2(loc_bogus, "Dataset5", H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
if (H5Dclose(did) < 0)
@@ -1089,13 +1096,13 @@ test_minimized_dset_ohdr_size_comparisons(hid_t fapl_id)
/* 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_N_id = -1; /* 'N' for explicit 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_N_id = -1; /* 'N' for explicit non-minimized dset */
hid_t dset_F_Y_id = -1; /* 'Y' for minimized dset */
char filename_a[512] = "";
@@ -1813,13 +1820,12 @@ main(void)
herr_t ret; /* Generic return value */
/* Get the VFD to use */
- env_h5_drvr = HDgetenv("HDF5_DRIVER");
+ 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") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
- HDstrcmp(env_h5_drvr, "family") != 0);
+ single_file_vfd = !h5_driver_uses_multiple_files(env_h5_drvr, 0);
/* Reset library */
h5_reset();
@@ -2107,11 +2113,15 @@ main(void)
if (h5_verify_cached_stabs(FILENAME, fapl) < 0)
TEST_ERROR
- /* A test to exercise the re-read of the object header for SWMR access */
- if (test_ohdr_swmr(TRUE) < 0)
- TEST_ERROR
- if (test_ohdr_swmr(FALSE) < 0)
- TEST_ERROR
+ if (H5FD__supports_swmr_test(env_h5_drvr)) {
+ /* A test to exercise the re-read of the object header for SWMR access */
+ if (test_ohdr_swmr(TRUE) < 0)
+ TEST_ERROR
+ if (test_ohdr_swmr(FALSE) < 0)
+ TEST_ERROR
+ }
+ else
+ HDputs("Skipped SWMR tests for SWMR-incompatible VFD");
/* Pop API context */
if (api_ctx_pushed && H5CX_pop(FALSE) < 0)
diff --git a/test/page_buffer.c b/test/page_buffer.c
index c7bb965..c3555aa 100644
--- a/test/page_buffer.c
+++ b/test/page_buffer.c
@@ -186,7 +186,7 @@ error:
* Any data mis-matches or failures reported by the HDF5
* library result in test failure.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: unknown
@@ -326,7 +326,7 @@ error:
* Any data mis-matches or failures reported by the HDF5
* library result in test failure.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: unknown
@@ -486,7 +486,7 @@ error:
* Any data mis-matches or unexpected failures or successes
* reported by the HDF5 library result in test failure.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: unknown
@@ -666,7 +666,7 @@ error:
* check that it appears *immediately* after max_lag + 1
* ticks, since the LRU list does not hold onto MPMDEs.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: David Young
@@ -811,7 +811,7 @@ error:
* XXX reduce duplication with test_spmde_delay_basic!
* XXX
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: David Young
@@ -989,7 +989,7 @@ error:
* XXX reduce duplication with test_mpmde_delay_basic!
* XXX
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: David Young
@@ -1118,7 +1118,7 @@ error:
* Any data mis-matches or failures reported by the HDF5
* library result in test failure.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: David Young
@@ -1453,7 +1453,7 @@ error:
* Any data mis-matches or failures reported by the HDF5
* library result in test failure.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: unknown
@@ -1706,7 +1706,7 @@ error:
* Any data mis-matches or failures reported by the HDF5
* library result in test failure.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: unknown
@@ -1725,7 +1725,7 @@ error:
*
* JRM -- 2/23/17
*
- * Reworked test for new implementatin of the page buffer.
+ * Reworked test for new implementation of the page buffer.
* The major change was adapting the test for the new
* page buffers refusal to buffer any raw data when
* min_md_pages == max_pages, or any metadata pages wwhen
@@ -2126,7 +2126,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
if (f->shared->page_buf->curr_rd_pages != 2)
TEST_ERROR;
- /* adding more meta entires should replace meta entries since raw data
+ /* adding more meta entries 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, data) < 0)
@@ -2141,7 +2141,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
if (f->shared->page_buf->curr_rd_pages != 2)
TEST_ERROR;
- /* bring existing raw entires up the LRU */
+ /* bring existing raw entries up the LRU */
if (H5F_block_read(f, H5FD_MEM_DRAW, raw_addr + (sizeof(int) * 750), sizeof(int) * 100, data) < 0)
FAIL_STACK_ERROR;
@@ -2180,7 +2180,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
if (f->shared->page_buf->curr_rd_pages != 3)
TEST_ERROR;
- /* adding 2 meta entries should replace 2 entires at the bottom
+ /* adding 2 meta entries should replace 2 entries at the bottom
* of the LRU
*/
if (H5F_block_read(f, H5FD_MEM_SUPER, meta_addr + (sizeof(int) * 98), sizeof(int) * 100, data) < 0)
@@ -2368,7 +2368,7 @@ error:
* Any data mis-matches or failures reported by the HDF5
* library result in test failure.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: unknown
@@ -2715,7 +2715,7 @@ error:
* At present, page buffering should be disabled in parallel
* builds. Verify this.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: John Mainzer
@@ -2883,7 +2883,7 @@ error:
* though it is not generating the I/O requests in this
* test.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: John Mainzer
@@ -2956,8 +2956,8 @@ md_entry_splitting_smoke_check(hid_t orig_fapl, const char *env_h5_drvr, bool vf
* from the free space manager, and perform several reads and writes to
* verify expected behaviour.
*
- * The synthetic set of metadata entries are constucted of integers
- * so as to allow easy assignement of unique values. It is constructed
+ * The synthetic set of metadata entries are constructed of integers
+ * so as to allow easy assignment of unique values. It is constructed
* as follows:
*
* size values: addr:
@@ -3178,7 +3178,7 @@ error:
* split correctly under a variety of conditions that
* are unlikely unless the user chooses at odd page size.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: John Mainzer
@@ -3251,7 +3251,7 @@ md_entry_splitting_boundary_test(hid_t orig_fapl, const char *env_h5_drvr, bool
if (base_page_cnt != 1)
TEST_ERROR;
- /* Test the folowing cases:
+ /* Test the following cases:
*
* 1) splittable md entry that is page aligned and exactly one
* page long.
@@ -3324,7 +3324,7 @@ md_entry_splitting_boundary_test(hid_t orig_fapl, const char *env_h5_drvr, bool
* should log 1 metadata insertions
*
* Note that exposes an inefficiency in the page buffer, as page
- * aligned I/O requests of exactly oen page in length really should
+ * aligned I/O requests of exactly one page in length really should
* bypass the page buffer.
*
* This should be fixed, but I am bypassing it for now.
@@ -4096,7 +4096,7 @@ error:
*
* Purpose: Main function for the page buffer tests.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: unknown
diff --git a/test/reserved.c b/test/reserved.c
index 6e41a16..08e747e 100644
--- a/test/reserved.c
+++ b/test/reserved.c
@@ -71,7 +71,7 @@ rsrv_heap(void)
}
H5E_END_TRY
- HDsprintf(dset_name, "Dset %d", i);
+ HDsnprintf(dset_name, sizeof(dset_name), "Dset %d", i);
H5E_BEGIN_TRY
{
@@ -115,7 +115,7 @@ rsrv_heap(void)
if (H5open() < 0)
TEST_ERROR;
- HDsprintf(dset_name, "Dset %d", i - 2);
+ HDsnprintf(dset_name, sizeof(dset_name), "Dset %d", i - 2);
file_id = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT);
if (file_id < 0)
@@ -218,7 +218,7 @@ rsrv_ohdr(void)
} /* end for */
for (i = 0; i < 2000; i++) {
- HDsprintf(attrname, "attr %d", i);
+ HDsnprintf(attrname, sizeof(attrname), "attr %d", i);
H5E_BEGIN_TRY
{
aid = H5Screate_simple(2, dims, NULL);
@@ -489,7 +489,7 @@ main(void)
hid_t fapl;
const char *envval = NULL;
- envval = HDgetenv("HDF5_DRIVER");
+ envval = HDgetenv(HDF5_DRIVER);
if (envval == NULL)
envval = "nomatch";
/* QAK: should be able to use the core driver? */
diff --git a/test/ros3.c b/test/ros3.c
index b7b27ed..a340985 100644
--- a/test/ros3.c
+++ b/test/ros3.c
@@ -1763,7 +1763,7 @@ main(void)
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 "
+ HDprintf("WARNING: S3 bucket url is not defined in environment "
"variable 'HDF5_ROS3_TEST_BUCKET_URL'!\n");
}
else {
diff --git a/test/s3comms.c b/test/s3comms.c
index cec7a27..45415cb 100644
--- a/test/s3comms.c
+++ b/test/s3comms.c
@@ -244,7 +244,7 @@ jserr_str(const char *expected, const char *actual, const char *reason)
}
#ifdef JSVERIFY_EXP_ACT
-/* VERIFY rountines with paramter order (<expected>, <actual> [, <msg> ])
+/* VERIFY routines with parameter order (<expected>, <actual> [, <msg> ])
*/
/*----------------------------------------------------------------------------
@@ -435,7 +435,7 @@ error:
*
* Purpose:
*
- * Demonstrate the construction of a Canoncial Request (and Signed Headers)
+ * Demonstrate the construction of a Canonical Request (and Signed Headers)
*
* Elided / not yet implemented:
* Query strings
@@ -730,7 +730,7 @@ test_hrb_init_request(void)
FALSE,
},
{
- "null verb substitues to GET",
+ "null verb substitutes to GET",
NULL,
"/MYPATH/MYFILE.tiff",
"/MYPATH/MYFILE.tiff",
@@ -1143,10 +1143,10 @@ test_hrb_node_set(void)
*********/
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];
+ const char *name = test->given[mock_i];
+ const char *value = test->given[mock_i + 1];
- FAIL_IF(SUCCEED != H5FD_s3comms_hrb_node_set(&list, name, valu))
+ FAIL_IF(SUCCEED != H5FD_s3comms_hrb_node_set(&list, name, value))
}
/********
* TEST *
@@ -1162,11 +1162,11 @@ test_hrb_node_set(void)
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];
+ const char *name = test->expected[mock_i];
+ const char *value = test->expected[mock_i + 1];
JSVERIFY_STR(name, node->name, NULL)
- JSVERIFY_STR(valu, node->value, NULL)
+ JSVERIFY_STR(value, node->value, NULL)
mock_i += 2;
node = node->next;
@@ -1559,7 +1559,7 @@ test_parse_url(void)
NULL,
"a=b&d=b",
},
- "QUERY with implict PATH",
+ "QUERY with implicit PATH",
},
{
"http://[5]/path?a=b&d=b",
@@ -2014,7 +2014,7 @@ error:
* H5FD_s3comms_s3r_read << called by getsize(), multiple times working
* H5FD_s3comms_s3r_close
*
- * Shows most basic curl interation.
+ * Shows most basic curl iteration.
*
* Programmer: Jacob Smith
* 2017-10-06
@@ -2610,7 +2610,7 @@ main(void)
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 "
+ HDprintf("WARNING: S3 bucket url is not defined in environment "
"variable 'HDF5_ROS3_TEST_BUCKET_URL'!\n");
}
else {
@@ -2618,7 +2618,7 @@ main(void)
s3_test_bucket_defined = TRUE;
}
- /* tests ordered rougly by dependence */
+ /* tests ordered roughly by dependence */
nerrors += test_macro_format_credential() < 0 ? 1 : 0;
nerrors += test_trim() < 0 ? 1 : 0;
nerrors += test_nlowercase() < 0 ? 1 : 0;
diff --git a/test/set_extent.c b/test/set_extent.c
index 3078c2d..4437219 100644
--- a/test/set_extent.c
+++ b/test/set_extent.c
@@ -115,12 +115,12 @@ main(void)
unsigned chunk_cache; /* Whether to enable chunk caching */
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 */
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contiguous address space */
- env_h5_drvr = HDgetenv("HDF5_DRIVER");
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
if (env_h5_drvr == NULL)
env_h5_drvr = "nomatch";
- /* Current VFD that does not support contigous address space */
+ /* Current VFD that does not support contiguous address space */
contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
/* Initialize random number seed */
@@ -343,35 +343,42 @@ do_ranks(hid_t fapl, hbool_t new_format)
goto error;
} /* end if */
- /* VL test */
- 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")
- HDprintf(" Index: %s\n", index_type == RANK4_INDEX_BTREE
- ? "btree"
- : (index_type == RANK4_INDEX_FARRAY ? "farray" : "earray"));
- goto error;
- } /* end if */
-
- /* Sparse allocation test (regular and VL) */
- if (!(config & CONFIG_EARLY_ALLOC)) {
- 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")
+ if (!h5_using_parallel_driver(NULL)) {
+ /* VL test */
+ 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")
HDprintf(" Index: %s\n",
index_type == RANK4_INDEX_BTREE
? "btree"
: (index_type == RANK4_INDEX_FARRAY ? "farray" : "earray"));
goto error;
} /* end if */
- 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")
+ }
+
+ /* Sparse allocation test (regular and VL) */
+ if (!(config & CONFIG_EARLY_ALLOC)) {
+ 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")
HDprintf(" Index: %s\n",
index_type == RANK4_INDEX_BTREE
? "btree"
: (index_type == RANK4_INDEX_FARRAY ? "farray" : "earray"));
goto error;
} /* end if */
- } /* end if */
+
+ if (!h5_using_parallel_driver(NULL)) {
+ 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")
+ HDprintf(" Index: %s\n",
+ index_type == RANK4_INDEX_BTREE
+ ? "btree"
+ : (index_type == RANK4_INDEX_FARRAY ? "farray" : "earray"));
+ goto error;
+ } /* end if */
+ }
+ } /* end if */
/* Break out if using the old format */
if (!new_format)
@@ -649,7 +656,7 @@ test_rank1(hid_t fapl, hid_t dcpl, hbool_t do_fill_value, hbool_t disable_edge_f
HDprintf("\n");
#endif
- /* compare the read array with the shrinked array */
+ /* compare the read array with the shrunk array */
for (i = 0; i < (int)dims_r[0]; i++)
if (buf_s[i] != buf_o[i]) {
HDprintf("buf_s[%d] = %d\n", i, buf_s[i]);
@@ -1055,7 +1062,7 @@ test_rank2(hid_t fapl, hid_t dcpl, hbool_t do_fill_value, hbool_t disable_edge_f
}
#endif
- /* compare the read array with the shrinked array */
+ /* compare the read array with the shrunk 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]) {
@@ -1536,7 +1543,7 @@ test_rank3(hid_t fapl, hid_t dcpl, hbool_t do_fill_value, hbool_t disable_edge_f
HDprintf("\n");
#endif
- /* compare the read array with the shrinked array */
+ /* compare the read array with the shrunk 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++) {
@@ -1734,7 +1741,7 @@ test_external(hid_t fapl)
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_s[DIMS0][DIMS1]; /* shrunk 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;
@@ -1946,7 +1953,7 @@ test_external(hid_t fapl)
}
#endif
- /* compare the read array with the shrinked array */
+ /* compare the read array with the shrunk 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]) {
diff --git a/test/stab.c b/test/stab.c
index 798619d..b3db76e 100644
--- a/test/stab.c
+++ b/test/stab.c
@@ -125,7 +125,7 @@ test_misc(hid_t fcpl, hid_t fapl, hbool_t new_format)
if (H5Gclose(g3) < 0)
TEST_ERROR
- /* Open all groups with absolute names to check for exsistence */
+ /* Open all groups with absolute names to check for existence */
if ((g1 = H5Gopen2(fid, "/test_1a", H5P_DEFAULT)) < 0)
TEST_ERROR
if ((g2 = H5Gopen2(fid, "/test_1a/sub_1", H5P_DEFAULT)) < 0)
@@ -1416,15 +1416,16 @@ main(void)
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;
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contiguous address space */
+ hbool_t driver_uses_modified_filename = h5_driver_uses_modified_filename();
+ int nerrors = 0;
/* Get the VFD to use */
- env_h5_drvr = HDgetenv("HDF5_DRIVER");
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
if (env_h5_drvr == NULL)
env_h5_drvr = "nomatch";
- /* VFD that does not support contigous address space */
+ /* VFD that does not support contiguous address space */
contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
/* Reset library */
@@ -1473,14 +1474,21 @@ main(void)
if (contig_addr_vfd) {
nerrors += lifecycle(fcpl2, fapl2);
nerrors += long_compact(fcpl2, fapl2);
- nerrors += read_old();
+
+ if (!driver_uses_modified_filename) {
+ nerrors += read_old();
+ }
+
nerrors += no_compact(fcpl2, fapl2);
nerrors += gcpl_on_root(fapl2);
}
/* Old group API specific tests */
nerrors += old_api(fapl);
- nerrors += corrupt_stab_msg();
+
+ if (!driver_uses_modified_filename) {
+ nerrors += corrupt_stab_msg();
+ }
/* Close 2nd FAPL */
H5Pclose(fapl2);
diff --git a/test/swmr.c b/test/swmr.c
index 9091fe2..dccd945 100644
--- a/test/swmr.c
+++ b/test/swmr.c
@@ -2395,7 +2395,7 @@ error:
* (5) Parent: open a file with write access; enable SWMR writing mode
* Child: concurrent open of the file with write and SWMR write access (fail)
*/
-#ifndef H5_HAVE_UNISTD_H
+#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID))
static int
test_start_swmr_write_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t new_format)
@@ -2408,11 +2408,11 @@ test_start_swmr_write_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t new_format)
}
SKIPPED();
- HDputs(" Test skipped due to a lack of unistd.h functionality.");
+ HDputs(" Test skipped due to fork or waitpid not defined.");
return 0;
} /* test_start_swmr_write_concur() */
-#else /* H5_HAVE_UNISTD_H */
+#else /* !defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID) */
static int
test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format)
@@ -3014,7 +3014,7 @@ error:
return -1;
} /* test_start_swmr_write_concur() */
-#endif /* H5_HAVE_UNISTD_H */
+#endif /* !defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID) */
/*
* test_start_swmr_write_stress_ohdr():
@@ -3666,7 +3666,7 @@ test_append_flush_dataset_chunked(hid_t in_fapl)
{
hid_t fid = -1; /* file ID */
hid_t fapl = -1; /* A copy of file access property */
- hid_t did1 = -1, did2 = -1; /* The datset ID */
+ hid_t did1 = -1, did2 = -1; /* The dataset ID */
hid_t sid = -1; /* The dataspace ID */
hid_t dcpl = -1; /* A copy of dataset creation property */
hid_t dapl = -1; /* A copy of dataset access property */
@@ -3889,7 +3889,7 @@ test_append_flush_dataset_fixed(hid_t in_fapl)
{
hid_t fid = -1; /* file ID */
hid_t fapl = -1; /* A copy of file access property */
- hid_t did1 = -1, did2 = -1; /* The datset ID */
+ hid_t did1 = -1, did2 = -1; /* The dataset ID */
hid_t sid = -1; /* The dataspace ID */
hid_t dapl = -1; /* A copy of dataset access property */
hid_t ddapl = -1; /* The dataset access property of the opened dataset */
@@ -4107,7 +4107,7 @@ test_append_flush_dataset_multiple(hid_t in_fapl)
{
hid_t fid = -1; /* file ID */
hid_t fapl = -1; /* A copy of file access property */
- hid_t did1 = -1, did2 = -1; /* The datset ID */
+ hid_t did1 = -1, did2 = -1; /* The dataset ID */
hid_t sid = -1; /* The dataspace ID */
hid_t dcpl = -1; /* A copy of dataset creation property */
hid_t dapl1 = -1; /* A copy of dataset access property */
@@ -4809,7 +4809,7 @@ error:
** This is for concurrent access.
**
*****************************************************************/
-#ifndef H5_HAVE_UNISTD_H
+#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) && defined(H5_HAVE_FLOCK))
static int
test_file_lock_concur(hid_t H5_ATTR_UNUSED in_fapl)
@@ -4817,12 +4817,12 @@ test_file_lock_concur(hid_t H5_ATTR_UNUSED in_fapl)
/* Output message about test being performed */
TESTING("File open with different combinations of flags--concurrent access");
SKIPPED();
- HDputs(" Test skipped due to a lack of unistd.h functionality.");
+ HDputs(" Test skipped due to fork or waitpid not defined.");
return 0;
} /* end test_file_lock_concur() */
-#else /* H5_HAVE_UNISTD_H */
+#else /* !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) && defined(H5_HAVE_FLOCK)) */
static int
test_file_lock_concur(hid_t in_fapl)
@@ -5192,7 +5192,7 @@ error:
} /* end test_file_lock_concur() */
-#endif /* H5_HAVE_UNISTD_H */
+#endif /* #if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) && defined(H5_HAVE_FLOCK)) */
/****************************************************************
**
@@ -5202,7 +5202,7 @@ error:
** This is for concurrent access.
**
*****************************************************************/
-#ifndef H5_HAVE_UNISTD_H
+#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID))
static int
test_file_lock_swmr_concur(hid_t H5_ATTR_UNUSED in_fapl)
@@ -5210,12 +5210,12 @@ test_file_lock_swmr_concur(hid_t H5_ATTR_UNUSED in_fapl)
/* Output message about test being performed */
TESTING("File open with different combintations of flags + SWMR flags--concurrent access");
SKIPPED();
- HDputs(" Test skipped due to a lack of unistd.h functionality.");
+ HDputs(" Test skipped due to fork or waitpid not defined.");
return 0;
} /* end test_file_lock_swmr_concur() */
-#else /* H5_HAVE_UNISTD_H */
+#else /* !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) */
static int
test_file_lock_swmr_concur(hid_t in_fapl)
@@ -6215,7 +6215,7 @@ error:
} /* end test_file_lock_swmr_concur() */
-#endif /* H5_HAVE_UNISTD_H */
+#endif /* !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) */
/****************************************************************
**
@@ -6227,7 +6227,7 @@ error:
static int
test_file_locking(hid_t in_fapl, hbool_t turn_locking_on, hbool_t env_var_override)
{
-#ifndef H5_HAVE_UNISTD_H
+#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID))
if (turn_locking_on && env_var_override)
TESTING("File locking: ON w/ env var override")
else if (turn_locking_on && !env_var_override)
@@ -6237,9 +6237,9 @@ test_file_locking(hid_t in_fapl, hbool_t turn_locking_on, hbool_t env_var_overri
else
TESTING("File locking: OFF")
SKIPPED();
- HDputs(" Test skipped due to a lack of unistd.h functionality.");
+ HDputs(" Test skipped due to fork or waitpid not defined.");
return 0;
-#else /* H5_HAVE_UNISTD_H */
+#else /* !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) */
hid_t fid = -1; /* File ID */
hid_t fapl = -1; /* File access property list */
char filename[NAME_BUF_SIZE]; /* file name */
@@ -6270,13 +6270,13 @@ test_file_locking(hid_t in_fapl, hbool_t turn_locking_on, hbool_t env_var_overri
/* If requested, set the environment variable */
if (env_var_override) {
- if (HDsetenv("HDF5_USE_FILE_LOCKING", turn_locking_on ? "FALSE" : "TRUE", TRUE) < 0)
+ if (HDsetenv(HDF5_USE_FILE_LOCKING, turn_locking_on ? "FALSE" : "TRUE", TRUE) < 0)
TEST_ERROR
if (H5F__reparse_file_lock_variable_test() < 0)
TEST_ERROR
}
else {
- if (HDsetenv("HDF5_USE_FILE_LOCKING", "", TRUE) < 0)
+ if (HDsetenv(HDF5_USE_FILE_LOCKING, "", TRUE) < 0)
TEST_ERROR
if (H5F__reparse_file_lock_variable_test() < 0)
TEST_ERROR
@@ -6405,7 +6405,7 @@ error:
return -1;
-#endif /* H5_HAVE_UNISTD_H */
+#endif /* !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) */
} /* end test_file_locking() */
@@ -6699,7 +6699,7 @@ error:
* (7) Refresh the dataset
* (8) Verify the dataset's dimension and data are correct
*/
-#ifndef H5_HAVE_UNISTD_H
+#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID))
static int
test_refresh_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t new_format)
@@ -6712,11 +6712,11 @@ test_refresh_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t new_format)
}
SKIPPED();
- HDputs(" Test skipped due to a lack of unistd.h functionality.");
+ HDputs(" Test skipped due to fork or waitpid not defined.");
return 0;
} /* test_refresh_concur() */
-#else /* H5_HAVE_UNISTD_H */
+#else /* !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) */
static int
test_refresh_concur(hid_t in_fapl, hbool_t new_format)
@@ -7016,7 +7016,7 @@ error:
return -1;
} /* test_refresh_concur() */
-#endif /* H5_HAVE_UNISTD_H */
+#endif /* !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) */
/*
* test_multiple_same():
@@ -7367,7 +7367,7 @@ main(void)
/* Skip this test if SWMR I/O is not supported for the VFD specified
* by the environment variable.
*/
- driver = HDgetenv("HDF5_DRIVER");
+ driver = HDgetenv(HDF5_DRIVER);
if (!H5FD__supports_swmr_test(driver)) {
HDprintf("This VFD does not support SWMR I/O\n");
return EXIT_SUCCESS;
@@ -7377,7 +7377,7 @@ main(void)
* about file locking. File locking should be used unless explicitly
* disabled.
*/
- lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING");
+ lock_env_var = HDgetenv(HDF5_USE_FILE_LOCKING);
if (lock_env_var && !HDstrcmp(lock_env_var, "FALSE"))
use_file_locking = FALSE;
else
@@ -7412,7 +7412,7 @@ main(void)
/*
* Modify the following routines to test for files:
* H5Fcreate(write, latest format) or H5Fcreate(SWMR write, non-latest-format)
- * --both result in v3 superblock and latest version suppport
+ * --both result in v3 superblock and latest version support
*/
nerrors += test_start_swmr_write(fapl, TRUE);
nerrors += test_start_swmr_write(fapl, FALSE);
@@ -7446,7 +7446,7 @@ main(void)
*
* Modify the following 2 routines to test for files:
* H5Fcreate(write, latest format) or H5Fcreate(SWMR write, non-latest-format)
- * --both result in v3 superblock and latest version suppport
+ * --both result in v3 superblock and latest version support
*/
nerrors += test_file_lock_swmr_same(fapl);
nerrors += test_file_lock_swmr_concur(fapl);
diff --git a/test/swmr_addrem_writer.c b/test/swmr_addrem_writer.c
index 5f0bba0..faf03dc 100644
--- a/test/swmr_addrem_writer.c
+++ b/test/swmr_addrem_writer.c
@@ -283,7 +283,7 @@ usage(void)
}
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
hid_t fid; /* File ID for file opened */
long nops = 0; /* # of times to grow or shrink the dataset */
diff --git a/test/swmr_check_compat_vfd.c b/test/swmr_check_compat_vfd.c
deleted file mode 100644
index 4133696..0000000
--- a/test/swmr_check_compat_vfd.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * 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://www.hdfgroup.org/licenses. *
- * If you do not have access to either file, you may request a copy from *
- * help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/* 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.
- */
-
-#include "h5test.h"
-
-/* This file needs to access the file driver testing code */
-#define H5FD_FRIEND /*suppress error about including H5FDpkg */
-#define H5FD_TESTING
-#include "H5FDpkg.h" /* File drivers */
-
-/*-------------------------------------------------------------------------
- * Function: main
- *
- * Purpose: Inspects the HDF5_DRIVER environment variable, which
- * determines the VFD that the test harness will use with
- * the majority of the tests.
- *
- * Return: VFD supports SWMR: EXIT_SUCCESS
- *
- * VFD does not support SWMR
- * or failure: EXIT_FAILURE
- *
- *-------------------------------------------------------------------------
- */
-int
-main(void)
-{
- char *driver = NULL;
-
- driver = HDgetenv("HDF5_DRIVER");
-
- if (H5FD__supports_swmr_test(driver))
- return EXIT_SUCCESS;
- else
- return EXIT_FAILURE;
-
-} /* end main() */
diff --git a/test/swmr_generator.c b/test/swmr_generator.c
index 2bff12c..93cfa0f 100644
--- a/test/swmr_generator.c
+++ b/test/swmr_generator.c
@@ -221,7 +221,7 @@ gen_skeleton(const char *filename, hbool_t verbose, hbool_t swmr_write, int comp
if (verbose)
HDfprintf(stderr, "Closing objects\n");
- /* Close everythign */
+ /* Close everything */
if (H5Pclose(dcpl) < 0)
return -1;
if (H5Sclose(sid) < 0)
@@ -258,7 +258,7 @@ usage(void)
} /* end usage() */
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
int comp_level = -1; /* Compression level (-1 is no compression) */
hbool_t verbose = TRUE; /* Whether to emit some informational messages */
diff --git a/test/swmr_reader.c b/test/swmr_reader.c
index cc16b92..a931cf7 100644
--- a/test/swmr_reader.c
+++ b/test/swmr_reader.c
@@ -387,7 +387,7 @@ usage(void)
}
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
long nseconds = 0; /* # of seconds to test */
int poll_time = 1; /* # of seconds between polling */
diff --git a/test/swmr_remove_reader.c b/test/swmr_remove_reader.c
index 0850b0b..9be602e 100644
--- a/test/swmr_remove_reader.c
+++ b/test/swmr_remove_reader.c
@@ -371,7 +371,7 @@ usage(void)
}
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
long nseconds = 0; /* # of seconds to test */
int poll_time = 1; /* # of seconds between polling */
diff --git a/test/swmr_remove_writer.c b/test/swmr_remove_writer.c
index e209285..4b4bb7b 100644
--- a/test/swmr_remove_writer.c
+++ b/test/swmr_remove_writer.c
@@ -217,7 +217,7 @@ usage(void)
}
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
hid_t fid; /* File ID for file opened */
long nshrinks = 0; /* # of times to shrink the dataset */
diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c
index 6c1bd19..4b8a36a 100644
--- a/test/swmr_sparse_reader.c
+++ b/test/swmr_sparse_reader.c
@@ -29,7 +29,6 @@
/* Headers */
/***********/
-#include <inttypes.h> /* for PRIu64 */
#include "h5test.h"
#include "swmr_common.h"
@@ -343,7 +342,7 @@ usage(void)
} /* end usage() */
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
long nrecords = 0; /* # of records to read */
int poll_time = 1; /* # of seconds to sleep when waiting for writer */
diff --git a/test/swmr_sparse_writer.c b/test/swmr_sparse_writer.c
index 2b46bb2..a7904ef 100644
--- a/test/swmr_sparse_writer.c
+++ b/test/swmr_sparse_writer.c
@@ -318,7 +318,7 @@ usage(void)
}
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
hid_t fid; /* File ID for file opened */
long nrecords = 0; /* # of records to append */
diff --git a/test/swmr_start_write.c b/test/swmr_start_write.c
index 9c51402..dc12b18 100644
--- a/test/swmr_start_write.c
+++ b/test/swmr_start_write.c
@@ -125,7 +125,7 @@ create_file(const char *filename, hbool_t verbose, FILE *verbose_file, unsigned
*
* Parameters:
* fid: file ID for the SWMR test file
- * comp_level: the compresssion level
+ * comp_level: the compression level
* index_type: The chunk index type (b1 | b2 | ea | fa)
* verbose: whether verbose console output is desired.
* verbose_file: file pointer for verbose output
@@ -352,7 +352,7 @@ usage(void)
*H5Fstart_swmr_write(), add_records(), H5Fclose().
*/
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
hid_t fid; /* File ID for file opened */
long nrecords = 0; /* # of records to append */
@@ -385,7 +385,7 @@ main(int argc, const char *argv[])
/* Chunk index type */
case 'i':
index_type = argv[u + 1];
- if (HDstrcmp(index_type, "ea") && HDstrcmp(index_type, "b2"))
+ if (HDstrcmp(index_type, "ea") != 0 && HDstrcmp(index_type, "b2") != 0)
usage();
u += 2;
break;
diff --git a/test/swmr_writer.c b/test/swmr_writer.c
index 6743f45..c44343d 100644
--- a/test/swmr_writer.c
+++ b/test/swmr_writer.c
@@ -275,7 +275,7 @@ usage(void)
}
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
hid_t fid; /* File ID for file opened */
long nrecords = 0; /* # of records to append */
diff --git a/test/tarray.c b/test/tarray.c
index af167a7..3b17239 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -2217,8 +2217,10 @@ test_array(void)
test_array_bkg(); /* Read compound datatype with array fields and background fields read */
- /* This test uses a custom file */
- test_compat(); /* Test compatibility changes for compound datatype fields */
+ if (!h5_driver_uses_modified_filename()) {
+ /* This test uses a custom file */
+ test_compat(); /* Test compatibility changes for compound datatype fields */
+ }
} /* end test_array() */
diff --git a/test/tattr.c b/test/tattr.c
index 756e139..2859f4c 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -2094,7 +2094,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 */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Aopen(loc_id, attrname, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Aopen");
@@ -2119,7 +2119,7 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr)
CHECK(attr, FAIL, "H5Aopen_by_idx");
/* Verify Name */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(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) != 0)
@@ -2219,7 +2219,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
/* Add attributes, until just before converting to dense storage */
for (u = 0; u < max_compact; u++) {
/* Create attribute */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -2238,7 +2238,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
/* Add one more attribute, to push into "dense" storage */
/* Create attribute */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -2274,9 +2274,11 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- /* Check size of file */
- filesize = h5_get_file_size(FILENAME, fapl);
- VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ if (h5_using_default_driver(NULL)) {
+ /* Check size of file */
+ filesize = h5_get_file_size(FILENAME, fapl);
+ VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ }
} /* test_attr_dense_create() */
/****************************************************************
@@ -2359,7 +2361,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
/* Add attributes, until just before converting to dense storage */
for (u = 0; u < max_compact; u++) {
/* Create attribute */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -2382,7 +2384,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
/* Add one more attribute, to push into "dense" storage */
/* Create attribute */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -2418,9 +2420,11 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- /* Check size of file */
- filesize = h5_get_file_size(FILENAME, fapl);
- VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ if (h5_using_default_driver(NULL)) {
+ /* Check size of file */
+ filesize = h5_get_file_size(FILENAME, fapl);
+ VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ }
} /* test_attr_dense_open() */
/****************************************************************
@@ -2448,6 +2452,10 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
int use_min_dset_oh = (dcpl_g != H5P_DEFAULT);
herr_t ret; /* Generic return value */
+ /* Only run this test for sec2/default driver */
+ if (!h5_using_default_driver(NULL))
+ return;
+
/* Output message about test being performed */
MESSAGE(5, ("Testing Deleting Attributes in Dense Storage\n"));
@@ -2515,7 +2523,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
/* Add attributes, until well into dense storage */
for (u = 0; u < (max_compact * 2); u++) {
/* Create attribute */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -2560,7 +2568,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 */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -2574,7 +2582,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Delete one more attribute, which should cause reversion to compact storage */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -2587,7 +2595,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "test_attr_dense_verify");
/* Delete another attribute, to verify deletion in compact storage */
- HDsprintf(attrname, "attr %02u", (u - 1));
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", (u - 1));
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -2611,9 +2619,11 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- /* Check size of file */
- filesize = h5_get_file_size(FILENAME, fapl);
- VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ if (h5_using_default_driver(NULL)) {
+ /* Check size of file */
+ filesize = h5_get_file_size(FILENAME, fapl);
+ VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ }
} /* test_attr_dense_delete() */
/****************************************************************
@@ -2643,6 +2653,10 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
unsigned use_corder; /* Track creation order or not */
herr_t ret; /* Generic return value */
+ /* Only run this test for sec2/default driver */
+ if (!h5_using_default_driver(NULL))
+ return;
+
/* Output message about test being performed */
MESSAGE(5, ("Testing Renaming Attributes in Dense Storage\n"));
@@ -2710,7 +2724,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
/* Add attributes, until well into dense storage */
for (u = 0; u < (max_compact * 2); u++) {
/* Create attribute */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, H5I_INVALID_HID, "H5Acreate2");
@@ -2776,7 +2790,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
unsigned value; /* Attribute value */
/* Open attribute */
- HDsprintf(attrname, "new attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "new attr %02u", u);
attr = H5Aopen(dataset, attrname, H5P_DEFAULT);
CHECK(attr, H5I_INVALID_HID, "H5Aopen");
@@ -2802,9 +2816,11 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- /* Check size of file */
- filesize = h5_get_file_size(FILENAME, fapl);
- VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ if (h5_using_default_driver(NULL)) {
+ /* Check size of file */
+ filesize = h5_get_file_size(FILENAME, fapl);
+ VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ }
} /* test_attr_dense_rename() */
/****************************************************************
@@ -2833,6 +2849,10 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
int use_min_dset_oh = (dcpl_g != H5P_DEFAULT);
herr_t ret; /* Generic return value */
+ /* Only run this test for sec2/default driver */
+ if (!h5_using_default_driver(NULL))
+ return;
+
/* Output message about test being performed */
MESSAGE(5, ("Testing Unlinking Object with Attributes in Dense Storage\n"));
@@ -2894,7 +2914,7 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
/* Add attributes, until well into dense storage */
for (u = 0; u < (max_compact * 2); u++) {
/* Create attribute */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -2945,9 +2965,11 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- /* Check size of file */
- filesize = h5_get_file_size(FILENAME, fapl);
- VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ if (h5_using_default_driver(NULL)) {
+ /* Check size of file */
+ filesize = h5_get_file_size(FILENAME, fapl);
+ VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ }
} /* test_attr_dense_unlink() */
/****************************************************************
@@ -3035,7 +3057,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
/* Create attribute */
u = 0;
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -3055,7 +3077,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
/* Create attribute */
u = 1;
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -3085,7 +3107,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
/* Delete attribute */
u = 0;
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -3109,9 +3131,11 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- /* Check size of file */
- filesize = h5_get_file_size(FILENAME, fapl);
- VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ if (h5_using_default_driver(NULL)) {
+ /* Check size of file */
+ filesize = h5_get_file_size(FILENAME, fapl);
+ VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ }
} /* test_attr_dense_limits() */
/****************************************************************
@@ -3192,7 +3216,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 */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -3215,7 +3239,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(sid2, FAIL, "H5Screate_simple");
/* Create attribute */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -3498,7 +3522,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 */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
add_attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(add_attr, FAIL, "H5Acreate2");
@@ -3566,7 +3590,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 */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(gid1, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -3732,7 +3756,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Create attribute */
u = 0;
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -3750,7 +3774,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Create attribute */
u = 1;
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -3768,7 +3792,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Create attribute */
u = 2;
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(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");
@@ -3791,7 +3815,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Create attribute */
u = 3;
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, big_sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -3813,7 +3837,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Delete attribute */
u = 1;
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -3827,7 +3851,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Delete attribute */
u = 3;
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -3841,7 +3865,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Delete attribute */
u = 2;
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -3855,7 +3879,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Delete attribute */
u = 0;
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -3896,9 +3920,11 @@ test_attr_big(hid_t fcpl, hid_t fapl)
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- /* Check size of file */
- filesize = h5_get_file_size(FILENAME, fapl);
- VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ if (h5_using_default_driver(NULL)) {
+ /* Check size of file */
+ filesize = h5_get_file_size(FILENAME, fapl);
+ VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ }
} /* test_attr_big() */
/****************************************************************
@@ -4105,9 +4131,11 @@ test_attr_null_space(hid_t fcpl, hid_t fapl)
ret = H5Sclose(null_sid);
CHECK(ret, FAIL, "H5Sclose");
- /* Check size of file */
- filesize = h5_get_file_size(FILENAME, fapl);
- VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ if (h5_using_default_driver(NULL)) {
+ /* Check size of file */
+ filesize = h5_get_file_size(FILENAME, fapl);
+ VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ }
} /* test_attr_null_space() */
/****************************************************************
@@ -4250,7 +4278,7 @@ test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Create many attributes */
for (u = 0; u < nattr; u++) {
- HDsprintf(attrname, "a-%06u", u);
+ HDsnprintf(attrname, sizeof(attrname), "a-%06u", u);
exists = H5Aexists(gid, attrname);
VERIFY(exists, FALSE, "H5Aexists");
@@ -4302,7 +4330,7 @@ test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl)
for (u = 0; u < nattr; u++) {
unsigned value; /* Attribute value */
- HDsprintf(attrname, "a-%06u", u);
+ HDsnprintf(attrname, sizeof(attrname), "a-%06u", u);
exists = H5Aexists(gid, attrname);
VERIFY(exists, TRUE, "H5Aexists");
@@ -4550,7 +4578,7 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
/* Create several attributes, but keep storage in compact form */
for (u = 0; u < max_compact; u++) {
/* Create attribute */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -4639,7 +4667,7 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
H5A_info_t ainfo; /* Attribute information */
/* Retrieve information for attribute */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
ret = H5Aget_info_by_name(my_dataset, ".", attrname, &ainfo, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Aget_info_by_name");
@@ -4754,7 +4782,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
/* Create several attributes, but keep storage in compact form */
for (u = 0; u < max_compact; u++) {
/* Create attribute */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -4777,7 +4805,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
} /* end for */
/* Create another attribute, to push into dense storage */
- HDsprintf(attrname, "attr %02u", max_compact);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", max_compact);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -4870,7 +4898,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
H5A_info_t ainfo; /* Attribute information */
/* Retrieve information for attribute */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
ret = H5Aget_info_by_name(my_dataset, ".", attrname, &ainfo, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Aget_info_by_name");
@@ -5143,7 +5171,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 */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -5166,7 +5194,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
} /* end for */
/* Create another attribute, to push into dense storage */
- HDsprintf(attrname, "attr %02u", max_compact);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", max_compact);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -5194,7 +5222,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
/* Delete several attributes from object, until attribute storage resumes compact form */
for (u = max_compact; u >= min_dense; u--) {
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
ret = H5Adelete(my_dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -5214,7 +5242,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
} /* end for */
/* Delete another attribute, to push attribute storage into compact form */
- HDsprintf(attrname, "attr %02u", (min_dense - 1));
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", (min_dense - 1));
ret = H5Adelete(my_dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -5230,7 +5258,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
/* Re-add attributes to get back into dense form */
for (u = (min_dense - 1); u < (max_compact + 1); u++) {
/* Create attribute */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -5317,7 +5345,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
/* Delete several attributes from object, until attribute storage resumes compact form */
for (u = max_compact; u >= min_dense; u--) {
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
ret = H5Adelete(my_dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -5337,7 +5365,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
} /* end for */
/* Delete another attribute, to push attribute storage into compact form */
- HDsprintf(attrname, "attr %02u", (min_dense - 1));
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", (min_dense - 1));
ret = H5Adelete(my_dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -5353,7 +5381,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
/* Re-add attributes to get back into dense form */
for (u = (min_dense - 1); u < (max_compact + 1); u++) {
/* Create attribute */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -5382,11 +5410,11 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
/* Delete all attributes */
for (u = max_compact; u > 0; u--) {
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
ret = H5Adelete(my_dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
} /* end for */
- HDsprintf(attrname, "attr %02u", 0);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", 0);
ret = H5Adelete(my_dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
} /* end for */
@@ -5526,7 +5554,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl)
/* Create attributes, until attribute storage is in dense form */
for (u = 0; u < max_compact * 2; u++) {
/* Create attribute */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -5858,7 +5886,7 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
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 */
+ /* Check for query on non-existent attribute */
ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, &ainfo,
H5P_DEFAULT);
VERIFY(ret, FAIL, "H5Aget_info_by_idx");
@@ -5869,7 +5897,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 */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -5909,7 +5937,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 */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -6346,14 +6374,14 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
is_dense = H5O__is_attr_dense_test(my_dataset);
VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
- /* Check for deleting non-existant attribute */
+ /* Check for deleting non-existent attribute */
ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT);
VERIFY(ret, FAIL, "H5Adelete_by_idx");
/* Create attributes, up to limit of compact form */
for (u = 0; u < max_compact; u++) {
/* Create attribute */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr =
H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -6428,9 +6456,9 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
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)
- HDsprintf(attrname, "attr %02u", (u + 1));
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", (u + 1));
else
- HDsprintf(attrname, "attr %02u", (max_compact - (u + 2)));
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", (max_compact - (u + 2)));
ret = HDstrcmp(attrname, tmpname);
VERIFY(ret, 0, "H5Aget_name_by_idx");
} /* end for */
@@ -6466,7 +6494,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 */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr =
H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -6556,9 +6584,10 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
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)
- HDsprintf(attrname, "attr %02u", (u + 1));
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", (u + 1));
else
- HDsprintf(attrname, "attr %02u", ((max_compact * 2) - (u + 2)));
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u",
+ ((max_compact * 2) - (u + 2)));
ret = HDstrcmp(attrname, tmpname);
VERIFY(ret, 0, "H5Aget_name_by_idx");
} /* end for */
@@ -6600,7 +6629,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 */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr =
H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -6669,9 +6698,10 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
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)
- HDsprintf(attrname, "attr %02u", ((u * 2) + 1));
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", ((u * 2) + 1));
else
- HDsprintf(attrname, "attr %02u", ((max_compact * 2) - ((u * 2) + 2)));
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u",
+ ((max_compact * 2) - ((u * 2) + 2)));
ret = HDstrcmp(attrname, tmpname);
VERIFY(ret, 0, "H5Aget_name_by_idx");
} /* end for */
@@ -6721,9 +6751,10 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
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)
- HDsprintf(attrname, "attr %02u", ((u * 2) + 3));
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", ((u * 2) + 3));
else
- HDsprintf(attrname, "attr %02u", ((max_compact * 2) - ((u * 2) + 4)));
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u",
+ ((max_compact * 2) - ((u * 2) + 4)));
ret = HDstrcmp(attrname, tmpname);
VERIFY(ret, 0, "H5Aget_name_by_idx");
} /* end for */
@@ -6804,7 +6835,7 @@ attr_iterate2_cb(hid_t loc_id, const char *attr_name, const H5A_info_t *info, vo
} /* end if */
/* Verify name of link */
- HDsprintf(attrname, "attr %02u", (unsigned)my_info.corder);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", (unsigned)my_info.corder);
if (HDstrcmp(attr_name, attrname) != 0)
return (H5_ITER_ERROR);
@@ -7314,7 +7345,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 */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr =
H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -7386,7 +7417,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 */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr =
H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -7678,7 +7709,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 */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr =
H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -7737,7 +7768,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 */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr =
H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -7842,7 +7873,7 @@ attr_open_check(hid_t fid, const char *dsetname, hid_t obj_id, unsigned max_attr
/* 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 */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr_id = H5Aopen(obj_id, attrname, H5P_DEFAULT);
CHECK(attr_id, FAIL, "H5Aopen");
@@ -7998,7 +8029,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
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 */
+ /* Check for opening a non-existent attribute on an object with no attributes */
ret_id = H5Aopen(my_dataset, "foo", H5P_DEFAULT);
VERIFY(ret_id, FAIL, "H5Aopen");
@@ -8011,7 +8042,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 */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -8037,7 +8068,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
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 */
+ /* Check for opening a non-existent attribute on an object with compact attribute storage */
ret_id = H5Aopen(my_dataset, "foo", H5P_DEFAULT);
VERIFY(ret_id, FAIL, "H5Aopen");
@@ -8077,7 +8108,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 */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -8118,7 +8149,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
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 */
+ /* Check for opening a non-existent attribute on an object with dense attribute storage */
ret_id = H5Aopen(my_dataset, "foo", H5P_DEFAULT);
VERIFY(ret_id, FAIL, "H5Aopen");
@@ -8260,7 +8291,7 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Create attributes, up to limit of compact form */
for (u = 0; u < max_compact; u++) {
/* Create attribute */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(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");
@@ -8317,7 +8348,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 */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(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");
@@ -8542,7 +8573,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
/* Add attributes to each dataset, until after converting to dense storage */
for (u = 0; u < max_compact * 2; u++) {
/* Create attribute name */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
/* Alternate between creating "small" & "big" attributes */
if (u % 2) {
@@ -8705,9 +8736,11 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- /* Check size of file */
- filesize = h5_get_file_size(FILENAME, fapl);
- VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ if (h5_using_default_driver(NULL)) {
+ /* Check size of file */
+ filesize = h5_get_file_size(FILENAME, fapl);
+ VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ }
} /* end for */
/* Close dataspaces */
@@ -8877,7 +8910,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
/* Add attributes to each dataset, until after converting to dense storage */
for (u = 0; u < max_compact * 2; u++) {
/* Create attribute name */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
/* Alternate between creating "small" & "big" attributes */
if (u % 2) {
@@ -9151,9 +9184,11 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- /* Check size of file */
- filesize = h5_get_file_size(FILENAME, fapl);
- VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ if (h5_using_default_driver(NULL)) {
+ /* Check size of file */
+ filesize = h5_get_file_size(FILENAME, fapl);
+ VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ }
} /* end for */
/* Close dataspaces */
@@ -9322,7 +9357,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
/* Add attributes to each dataset, until after converting to dense storage */
for (u = 0; u < max_compact * 2; u++) {
/* Create attribute name */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
/* Alternate between creating "small" & "big" attributes */
if (u % 2) {
@@ -9430,7 +9465,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
/* Delete attributes from second dataset */
for (u = 0; u < max_compact * 2; u++) {
/* Create attribute name */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
/* Delete second dataset's attribute */
ret = H5Adelete_by_name(fid, DSET2_NAME, attrname, H5P_DEFAULT);
@@ -9521,9 +9556,11 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- /* Check size of file */
- filesize = h5_get_file_size(FILENAME, fapl);
- VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ if (h5_using_default_driver(NULL)) {
+ /* Check size of file */
+ filesize = h5_get_file_size(FILENAME, fapl);
+ VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ }
} /* end for */
/* Close dataspaces */
@@ -9692,7 +9729,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
/* Add attributes to each dataset, until after converting to dense storage */
for (u = 0; u < max_compact * 2; u++) {
/* Create attribute name */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
/* Alternate between creating "small" & "big" attributes */
if (u % 2) {
@@ -9816,7 +9853,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
/* Check ref count on attributes of first dataset */
for (u = 0; u < max_compact * 2; u++) {
/* Create attribute name */
- HDsprintf(attrname, "attr %02u", u);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", u);
/* Open attribute on first dataset */
attr = H5Aopen(dataset, attrname, H5P_DEFAULT);
@@ -9878,9 +9915,11 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- /* Check size of file */
- filesize = h5_get_file_size(FILENAME, fapl);
- VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ if (h5_using_default_driver(NULL)) {
+ /* Check size of file */
+ filesize = h5_get_file_size(FILENAME, fapl);
+ VERIFY(filesize, empty_filesize, "h5_get_file_size");
+ }
} /* end for */
/* Close dataspaces */
@@ -10986,7 +11025,7 @@ test_attr_bug8(hid_t fcpl, hid_t fapl)
** 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
+** initially be too small and a new NULL message must be
** created.
**
****************************************************************/
diff --git a/test/tcoords.c b/test/tcoords.c
index fef8689..b2d68d3 100644
--- a/test/tcoords.c
+++ b/test/tcoords.c
@@ -17,7 +17,7 @@
*
* Test the element coordinates for dataspace selection. For
* chunked dataset, when the hyperslab selection of some
- * dimensions is full, the library optimize it by "flattenning"
+ * dimensions is full, the library optimize it by "flattening"
* the fully selected dimensions. This program tests if the
* coordinates of selected elements are correctly calculated.
*
diff --git a/test/test_usecases.sh.in b/test/test_usecases.sh.in
index eaa875e..fd30afd 100644
--- a/test/test_usecases.sh.in
+++ b/test/test_usecases.sh.in
@@ -21,17 +21,26 @@
# For now, it shows how to run the test cases programs. It only verifies the
# exit codes are okay (0).
-srcdir=@srcdir@
-bindir=@bindir@
+###############################################################################
+## test variables
+###############################################################################
-# If the bindir directory is not set just use current (.).
-if test -z "$bindir"; then
- bindir=.
-fi
+# Number of errors encountered during test run.
+nerrors=0
+
+# Define variables
+verbose=yes
+
+###############################################################################
+## Main
+###############################################################################
+srcdir=@srcdir@
+utils_testdir=@abs_top_builddir@/@H5_UTILS_TEST_BUILDDIR@
+testdir=@abs_top_builddir@/@H5_TEST_BUILDDIR@
# Check to see if the VFD specified by the HDF5_DRIVER environment variable
# supports SWMR.
-$bindir/swmr_check_compat_vfd
+$utils_testdir/swmr_check_compat_vfd
rc=$?
if [[ $rc != 0 ]] ; then
echo
@@ -53,10 +62,6 @@ RESULT_SKIP="-SKIP-"
USECASES_PROGRAMS="use_append_chunk use_append_mchunks"
TESTNAME="Use Case"
-# Define variables
-nerrors=0
-verbose=yes
-
# Source in the output filter function definitions.
. $srcdir/../bin/output_filter.sh
@@ -91,7 +96,7 @@ TOOLTEST() {
# Run test.
TESTING $program $@
(
- $RUNSERIAL $bindir/$program "$@"
+ $RUNSERIAL $testdir/$program "$@"
) >$actual 2>$actual_err
exit_code=$?
@@ -123,7 +128,7 @@ TOOLTEST() {
# the test. Running each of these tests in its own directory should eliminate
# the problem.
mkdir usecases_test
-cp twriteorder usecases_test
+cp $testdir/twriteorder usecases_test
for FILE in use_*; do
case "$FILE" in
*.o) continue ;; ## don't copy the .o files
diff --git a/test/testcheck_version.sh.in b/test/testcheck_version.sh.in
index 6378ee5..273702e 100644
--- a/test/testcheck_version.sh.in
+++ b/test/testcheck_version.sh.in
@@ -36,7 +36,7 @@ RM='rm -f'
PURPOSE() {
echo "Tests for the H5check_version function."
echo "Note that abort messages may appear due to the expected termination"
- echo "of the program when it is tested with mis-matched version numnbers."
+ echo "of the program when it is tested with mis-matched version numbers."
}
# Print a line-line message left justified in a field of 70 characters.
@@ -232,7 +232,7 @@ esac
# RUNSERIAL is used. Check if it can return exit code from executalbe correctly.
if [ -n "$RUNSERIAL_NOEXITCODE" ]; then
- echo "***Warning*** Serial Exit Code is not passed back to shell corretly."
+ echo "***Warning*** Serial Exit Code is not passed back to shell correctly."
echo "***Warning*** Exit code checking is skipped."
h5haveexitcode=no
fi
diff --git a/test/testflushrefresh.sh.in b/test/testflushrefresh.sh.in
index 83685e8..209d370 100644
--- a/test/testflushrefresh.sh.in
+++ b/test/testflushrefresh.sh.in
@@ -58,14 +58,13 @@ fi
###############################################################################
## Main
###############################################################################
-# The build (current) directory might be different than the source directory.
-if test -z "$srcdir"; then
- srcdir=.
-fi
+srcdir=@srcdir@
+utils_testdir=@abs_top_builddir@/@H5_UTILS_TEST_BUILDDIR@
+testdir=@abs_top_builddir@/@H5_TEST_BUILDDIR@
# Check to see if the VFD specified by the HDF5_DRIVER environment variable
# supports SWMR.
-./swmr_check_compat_vfd
+$utils_testdir/swmr_check_compat_vfd
rc=$?
if [ $rc -ne 0 ] ; then
echo
@@ -83,7 +82,7 @@ fi
# the test. Running each of these tests in its own directory should eliminate
# the problem.
mkdir -p flushrefresh_test
-cp flushrefresh flushrefresh_test
+cp $testdir/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
@@ -118,7 +117,7 @@ fi
# ========================
# Launch the Test Program.
# ========================
-./flushrefresh &
+$testdir/flushrefresh &
pid_main=$!
# =======================================
@@ -155,7 +154,7 @@ until [ $verification_done -eq 1 ]; do
verification_done=1
echo "all flush verification complete" > $endsignal
else
- ./flushrefresh $param1 $param2
+ $testdir/flushrefresh $param1 $param2
# Check for core dump
if [ $? -gt 0 ]; then
@@ -200,7 +199,7 @@ if [ $timedout -eq 0 ]; then
verification_done=2
echo "all refresh verification complete" > $endsignal
else
- ./flushrefresh $param1
+ $testdir/flushrefresh $param1
# Check for core dump
if [ $? -gt 0 ]; then
diff --git a/test/testhdf5.c b/test/testhdf5.c
index 45c0f9f..dc5f0aa 100644
--- a/test/testhdf5.c
+++ b/test/testhdf5.c
@@ -81,7 +81,7 @@ main(int argc, char *argv[])
TestSummary();
/* Clean up test files, if allowed */
- if (GetTestCleanup() && !HDgetenv("HDF5_NOCLEANUP"))
+ if (GetTestCleanup() && !HDgetenv(HDF5_NOCLEANUP))
TestCleanup();
/* Release test infrastructure */
diff --git a/test/testlibinfo.sh.in b/test/testlibinfo.sh.in
index 2a9a05c..d9fee48 100644
--- a/test/testlibinfo.sh.in
+++ b/test/testlibinfo.sh.in
@@ -19,7 +19,7 @@
# libhdf5.settings file.
# Part 2:
# If executable is linked with the static hdf5 library (how to determine?),
-# verify an executable indeed contains an exact copy of hte content of the
+# verify an executable indeed contains an exact copy of the content of the
# libhdf5.settings file.
#
# Programmer: Albert Cheng
diff --git a/test/testmeta.c b/test/testmeta.c
index 7cb3000..a3b5160 100644
--- a/test/testmeta.c
+++ b/test/testmeta.c
@@ -15,7 +15,7 @@
* This program illustrates assertion errors when linked
* to HDF5 1.4.1-post2 or 1.4.2-pre3 debug library.
*
- * If the assertion errors are ignored, the program eventially causes
+ * If the assertion errors are ignored, the program eventually causes
* an error in H5Gcreate2 when writing object 83381.
*
* When writing in single file mode, the assertion errors still occur
diff --git a/test/testswmr.pwsh.in b/test/testswmr.pwsh.in
new file mode 100644
index 0000000..de7a57a
--- /dev/null
+++ b/test/testswmr.pwsh.in
@@ -0,0 +1,519 @@
+# 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://www.hdfgroup.org/licenses.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+# Tests for the swmr feature.
+
+$srcdir = '@srcdir@'
+$utils_testdir=@H5_UTILS_TEST_BUILDDIR@
+$testdir=@H5_TEST_BUILDDIR@
+
+###############################################################################
+## test parameters
+###############################################################################
+
+$Nreaders = 5 # number of readers to launch
+$Nrdrs_spa = 3 # number of sparse readers to launch
+$Nrecords = 200000 # number of records to write
+$Nrecs_rem = 40000 # number of times to shrink
+$Nrecs_spa = 20000 # number of records to write in the sparse test
+$Nsecs_add = 5 # number of seconds per read interval
+$Nsecs_rem = 3 # number of seconds per read interval
+$Nsecs_addrem = 8 # number of seconds per read interval
+$nerrors = 0
+
+###############################################################################
+## definitions for message file to coordinate test runs
+###############################################################################
+$WRITER_MESSAGE = 'SWMR_WRITER_MESSAGE' # The message file created by writer that the open is complete
+ # This should be the same as the define in "test/swmr_common.h"
+$MESSAGE_TIMEOUT = 300 # Message timeout length in secs
+ # This should be the same as the define in "test/h5test.h"
+
+# Print a line-line message left justified in a field of 70 characters
+# beginning with the word "Testing".
+#
+function Test-WithSpaces {
+ $SPACES=' '
+ #Write-Output "Testing $* $SPACES" | cut -c1-70 | tr -d '\012'
+}
+
+# To wait for the writer message file or till the maximum # of seconds is reached
+# $Message is the message file to wait for
+# This performs similar function as the routine h5_wait_message() in test/h5test.c
+function Wait-Message {
+ [CmdletBinding()]
+ param (
+ [Parameter(Mandatory, ValueFromPipeline)]
+ [string]$TestPath, # Get the path of the message file to wait for
+ [Parameter(Mandatory, ValueFromPipeline)]
+ [string]$Message # Get the name of the message file to wait for
+ )
+
+ PROCESS {
+ $message = Join-Path -Path $TestPath -ChildPath $Message
+ $t0 = Get-Date # Get current time
+ $t1 = $t0
+ $difft = New-Timespan -Start $t0 -End $t1 # Initialize the time difference
+ $mexist = 0 # Indicate whether the message file is found
+ while ($difft.TotalSeconds -lt $MESSAGE_TIMEOUT) { # Loop till message times out
+ $t1 = Get-Date # Get current time in seconds
+ $difft = New-Timespan -Start $t0 -End $t1 # Calculate the time difference
+ #Write-Output "Check for $message : time=$difft"
+ if ([System.IO.File]::Exists($message)) { # If message file is found:
+ $mexist = 1 # indicate the message file is found
+ Remove-Item $message # remove the message file
+ break # get out of the while loop
+ }
+ }
+ if ($mexist -eq 0) {
+ # Issue warning that the writer message file is not found, continue with launching the reader(s)
+ Write-Warning -Message "$WRITER_MESSAGE is not found after waiting $MESSAGE_TIMEOUT seconds"
+ }
+ else {
+ Write-Output "$WRITER_MESSAGE is found"
+ }
+ }
+}
+
+###############################################################################
+## Main
+##
+## Modifications:
+## Vailin Choi; July 2013
+## Add waiting of message file before launching the reader(s).
+## Due to the implementation of file locking, coordination
+## is needed in file opening for the writer/reader tests
+## to proceed as expected.
+##
+###############################################################################
+
+# Check to see if the VFD specified by the HDF5_DRIVER environment variable
+# supports SWMR.
+$testprog = Join-Path -Path $utils_testdir -ChildPath swmr_check_compat_vfd.exe
+$rp = Start-Process -FilePath $testprog -PassThru -Wait -NoNewWindow
+if ($rp.ExitCode -ne 0) {
+ Write-Output ""
+ Write-Output "The VFD specified by the HDF5_DRIVER environment variable"
+ Write-Output "does not support SWMR."
+ Write-Output ""
+ Write-Output "SWMR acceptance tests skipped"
+ Write-Output ""
+ exit 0
+}
+
+Set-Location -Path swmr_test
+$testdir = Join-Path -Path $testdir -ChildPath swmr_test
+
+# Loop over index types
+$IndexTypeLoop = '-i ea', '-i b2'
+foreach ($index_type in $IndexTypeLoop) {
+ # Try with and without compression
+ $CompressLoop = '', '-c 5'
+ foreach ($compress in $CompressLoop) {
+ Write-Output ""
+ Write-Output "*******************************************************************************"
+ Write-Output "** Loop testing parameters: $index_type $compress"
+ Write-Output "*******************************************************************************"
+ Write-Output ""
+ Write-Output ""
+ Write-Output "###############################################################################"
+ Write-Output "## Generator test"
+ Write-Output "###############################################################################"
+ # Launch the Generator without SWMR_WRITE
+ Write-Output "launch the swmr_generator"
+ $rp = Start-Process -FilePath $testdir/swmr_generator.exe -NoNewWindow -ArgumentList "$compress $index_type" -PassThru -Wait
+ if ($rp.ExitCode -ne 0) {
+ Write-Warning "generator had error"
+ $nerrors += 1
+ }
+
+ # Launch the Generator with SWMR_WRITE
+ Write-Output "launch the swmr_generator with SWMR_WRITE"
+ $rp = Start-Process -FilePath $testdir/swmr_generator.exe -NoNewWindow -ArgumentList "-s $compress $index_type" -PassThru -Wait
+ if ($rp.ExitCode -ne 0) {
+ Write-Warning "generator had error"
+ $nerrors += 1
+ }
+
+ # Check for error and exit if one occurred
+ #Write-Output "nerrors=$nerrors"
+ if ($nerrors -ne 0) {
+ Write-Warning "SWMR tests failed with $nerrors errors."
+ exit 1
+ }
+
+ Write-Output ""
+ Write-Output "###############################################################################"
+ Write-Output "## Use H5Fstart_swmr_write() to enable SWMR writing mode"
+ Write-Output "###############################################################################"
+
+ # Remove any possible writer message file before launching writer
+ if ([System.IO.File]::Exists($WRITER_MESSAGE)) { # If message file is found
+ Remove-Item $WRITER_MESSAGE
+ }
+ #
+ # Launch the Writer
+ Write-Output "launch the swmr_start_writer"
+ $seed = "" # Put -r <random seed> command here
+ $rp = Start-Process -FilePath $testdir/swmr_start_write.exe -NoNewWindow -PassThru -ArgumentList "$compress $index_type $Nrecords $seed" 2>&1 |tee swmr_writer.out
+ $pid_writer = $rp.id
+ #Write-Output "pid_writer=$pid_writer"
+
+ # Wait for message from writer process before starting reader(s)
+ Wait-Message $testdir $WRITER_MESSAGE
+
+ #
+ # Launch the Readers
+ #declare -a seeds = (<seed1> <seed2> <seed3> ... )
+ Write-Output "launch $Nreaders swmr_readers"
+ $pid_readers = @()
+ $n = 0
+ while ($n -lt $Nreaders) {
+ #seed = "-r ${seeds[$n]}"
+ $seed = ""
+ $rp = Start-Process -FilePath $testdir/swmr_reader.exe -NoNewWindow -PassThru -ArgumentList "$Nsecs_add $seed" 2>&1 | tee swmr_reader.out.$n
+ $pid_readers += $rp.id
+ $n += 1
+ }
+ #Write-Output "pid_readers=$pid_readers"
+
+ # Collect exit code of the readers first because they usually finish
+ # before the writer.
+ foreach ($xpid in $pid_readers) {
+ #Write-Output "checked reader $xpid"
+ $result = Wait-Process -Id $xpid
+ if ($result.ExitCode -ne 0) {
+ Write-Warning "reader had error"
+ $nerrors += 1
+ }
+ }
+
+ # Collect exit code of the writer
+ #Write-Output "checked writer $pid_writer"
+ $result = Wait-Process -Id $pid_writer
+ if ($result.ExitCode -ne 0) {
+ Write-Warning "writer had error"
+ $nerrors += 1
+ }
+
+ # Check for error and exit if one occurred
+ #Write-Output "nerrors=$nerrors"
+ if ($nerrors -ne 0) {
+ Write-Warning "SWMR tests failed with $nerrors errors."
+ Write-Warning "(Writer and reader output preserved)"
+ exit 1
+ }
+
+ # Clean up output files
+ Remove-Item swmr_writer.out
+ Remove-Item swmr_reader.out.*
+
+ Write-Output ""
+ Write-Output "###############################################################################"
+ Write-Output "## Writer test - test expanding the dataset"
+ Write-Output "###############################################################################"
+
+ # Launch the Generator
+ Write-Output "launch the swmr_generator"
+ $rp = Start-Process -FilePath $testdir/swmr_generator.exe -NoNewWindow -PassThru -Wait -ArgumentList "-s $compress $index_type"
+ if ($rp.ExitCode -ne 0) {
+ Write-Warning "generator had error"
+ $nerrors += 1
+ }
+
+ # Remove any possible writer message file before launching writer
+ Remove-Item $WRITER_MESSAGE
+ #
+ # Launch the Writer
+ Write-Output "launch the swmr_writer"
+ $seed = "" # Put -r <random seed> command here
+ $rp = Start-Process -FilePath $testdir/swmr_writer.exe -NoNewWindow -PassThru -ArgumentList "-o $Nrecords $seed" 2>&1 |tee swmr_writer.out
+ $pid_writer = $rp.id
+ #Write-Output "pid_writer=$pid_writer"
+
+ # Wait for message from writer process before starting reader(s)
+ Wait-Message $testdir $WRITER_MESSAGE
+ #
+ # Launch the Readers
+ #declare -a seeds = (<seed1> <seed2> <seed3> ... )
+ Write-Output "launch $Nreaders swmr_readers"
+ $pid_readers = @()
+ $n = 0
+ while ($n -lt $Nreaders) {
+ #seed = "-r ${seeds[$n]}"
+ $seed = ""
+ $rp = Start-Process -FilePath $testdir/swmr_reader.exe -NoNewWindow -PassThru -ArgumentList "$Nsecs_add $seed" 2>&1 |tee swmr_reader.out.$n
+ $pid_readers += $rp.id
+ $n += 1
+ }
+ #Write-Output "pid_readers=$pid_readers"
+
+ # Collect exit code of the readers first because they usually finish
+ # before the writer.
+ foreach ($xpid in $pid_readers) {
+ #Write-Output "checked reader $xpid"
+ $result = Wait-Process -Id $xpid
+ if ($result.ExitCode -ne 0) {
+ Write-Warning "reader had error"
+ $nerrors += 1
+ }
+ }
+
+ # Collect exit code of the writer
+ #Write-Output "checked writer $pid_writer"
+ $result = Wait-Process -Id $pid_writer
+ if ($result.ExitCode -ne 0) {
+ Write-Warning "writer had error"
+ $nerrors += 1
+ }
+
+ # Check for error and exit if one occurred
+ #Write-Output "nerrors=$nerrors"
+ if ($nerrors -ne 0) {
+ Write-Warning "SWMR tests failed with $nerrors errors."
+ Write-Warning "(Writer and reader output preserved)"
+ exit 1
+ }
+
+ # Clean up output files
+ Remove-Item swmr_writer.out
+ Remove-Item swmr_reader.out.*
+
+ Write-Output ""
+ Write-Output "###############################################################################"
+ Write-Output "## Remove test - test shrinking the dataset"
+ Write-Output "###############################################################################"
+
+ # Remove any possible writer message file before launching writer
+ Remove-Item $WRITER_MESSAGE
+ # Launch the Remove Writer
+ Write-Output "launch the swmr_remove_writer"
+ $seed = "" # Put -r <random seed> command here
+ $rp = Start-Process -FilePath $testdir/swmr_remove_writer.exe -NoNewWindow -PassThru -ArgumentList "-o $Nrecs_rem $seed" 2>&1 |tee swmr_writer.out
+ $pid_writer = $rp.id
+ #Write-Output "pid_writer=$pid_writer"
+
+ # Wait for message from writer process before starting reader(s)
+ Wait-Message $testdir $WRITER_MESSAGE
+ #
+ # Launch the Remove Readers
+ #declare -a seeds = (<seed1> <seed2> <seed3> ... )
+ $n = 0
+ $pid_readers = @()
+ Write-Output "launch $Nreaders swmr_remove_readers"
+ while ($n -lt $Nreaders) {
+ #seed = "-r ${seeds[$n]}"
+ $seed = ""
+ $rp = Start-Process -FilePath $testdir/swmr_remove_reader.exe -NoNewWindow -PassThru -ArgumentList "$Nsecs_rem $seed" 2>&1 |tee swmr_reader.out.$n
+ $pid_readers += $rp.id
+ $n += 1
+ }
+ #Write-Output "pid_readers=$pid_readers"
+
+ # Collect exit code of the readers first because they usually finish
+ # before the writer.
+ foreach ($xpid in $pid_readers) {
+ #Write-Output "checked reader $xpid"
+ $result = Wait-Process -Id $xpid
+ if ($result.ExitCode -ne 0) {
+ Write-Warning "reader had error"
+ $nerrors += 1
+ }
+ }
+
+ # Collect exit code of the writer
+ #Write-Output "checked writer $pid_writer"
+ $result = Wait-Process -Id $pid_writer
+ if ($result.ExitCode -ne 0) {
+ Write-Warning "writer had error"
+ $nerrors += 1
+ }
+
+ # Check for error and exit if one occurred
+ #Write-Output "nerrors=$nerrors"
+ if ($nerrors -ne 0) {
+ Write-Warning "SWMR tests failed with $nerrors errors."
+ Write-Warning "(Writer and reader output preserved)"
+ exit 1
+ }
+
+ # Clean up output files
+ Remove-Item swmr_writer.out
+ Remove-Item swmr_reader.out.*
+
+ Write-Output ""
+ Write-Output "###############################################################################"
+ Write-Output "## Add/remove test - randomly grow or shrink the dataset"
+ Write-Output "###############################################################################"
+
+ # Launch the Generator
+ Write-Output "launch the swmr_generator"
+ $rp = Start-Process -FilePath $testdir/swmr_generator.exe -NoNewWindow-PassThru -Wait -ArgumentList "$compress $index_type"
+ if ($rp.ExitCode -ne 0) {
+ Write-Warning "generator had error"
+ $nerrors += 1
+ }
+
+ # Launch the Writer (not in parallel - just to rebuild the datasets)
+ Write-Output "launch the swmr_writer"
+ $seed = "" # Put -r <random seed> command here
+ $rp = Start-Process -FilePath $testdir/swmr_writer.exe -NoNewWindow -PassThru -Wait -ArgumentList "$Nrecords $seed"
+ if ($rp.ExitCode -ne 0) {
+ Write-Warning "writer had error"
+ $nerrors += 1
+ }
+
+ # Remove any possible writer message file before launching writer
+ Remove-Item $WRITER_MESSAGE
+ #
+ # Launch the Add/Remove Writer
+ Write-Output "launch the swmr_addrem_writer"
+ $seed = "" # Put -r <random seed> command here
+ $rp = Start-Process -FilePath $testdir/swmr_addrem_writer.exe -NoNewWindow -PassThru -ArgumentList "$Nrecords $seed" 2>&1 |tee swmr_writer.out
+ $pid_writer = $rp.id
+ #Write-Output "pid_writer=$pid_writer"
+
+ # Wait for message from writer process before starting reader(s)
+ Wait-Message $testdir $WRITER_MESSAGE
+ #
+ # Launch the Add/Remove Readers
+ #declare -a seeds = (<seed1> <seed2> <seed3> ... )
+ $n = 0
+ $pid_readers = @()
+ Write-Output "launch $Nreaders swmr_remove_readers"
+ while ($n -lt $Nreaders) {
+ #seed = "-r ${seeds[$n]}"
+ $seed = ""
+ $rp = Start-Process -FilePath $testdir/swmr_remove_reader.exe -NoNewWindow -PassThru -ArgumentList "$Nsecs_addrem $seed" 2>&1 |tee swmr_reader.out.$n
+ $pid_readers += $rp.id
+ $n += 1
+ }
+ #Write-Output "pid_readers=$pid_readers"
+
+ # Collect exit code of the readers first because they usually finish
+ # before the writer.
+ foreach ($xpid in $pid_readers) {
+ #Write-Output "checked reader $xpid"
+ $result = Wait-Process -Id $xpid
+ if ($result.ExitCode -ne 0) {
+ Write-Warning "reader had error"
+ $nerrors += 1
+ }
+ }
+
+ # Collect exit code of the writer
+ #Write-Output "checked writer $pid_writer"
+ $result = Wait-Process -Id $pid_writer
+ if ($result.ExitCode -ne 0) {
+ Write-Warning "writer had error"
+ $nerrors += 1
+ }
+
+ # Check for error and exit if one occurred
+ #Write-Output "nerrors=$nerrors"
+ if ($nerrors -ne 0) {
+ Write-Warning "SWMR tests failed with $nerrors errors."
+ Write-Warning "(Writer and reader output preserved)"
+ exit 1
+ }
+
+ # Clean up output files
+ Remove-Item swmr_writer.out
+ Remove-Item swmr_reader.out.*
+
+ Write-Output ""
+ Write-Output "###############################################################################"
+ Write-Output "## Sparse writer test - test writing to random locations in the dataset"
+ Write-Output "###############################################################################"
+
+ # Launch the Generator
+ # NOTE: Random seed is shared between readers and writers and is
+ # created by the generator.
+ Write-Output "launch the swmr_generator"
+ $seed = "" # Put -r <random seed> command here
+ $rp = Start-Process -FilePath $testdir/swmr_generator.exe -NoNewWindow -PassThru -Wait -ArgumentList "$compress $index_type $seed"
+ if ($rp.ExitCode -ne 0) {
+ Write-Warning "generator had error"
+ $nerrors += 1
+ }
+
+ # Remove any possible writer message file before launching writer
+ Remove-Item $WRITER_MESSAGE
+ # Launch the Sparse writer
+ Write-Output "launch the swmr_sparse_writer"
+ $rp = Start-Process -FilePath $testdir/swmr_sparse_writer.exe -NoNewWindow -PassThru -ArgumentList "$Nrecs_spa" 2>&1 |tee swmr_writer.out
+ $pid_writer = $rp.Id
+ #Write-Output "pid_writer=$pid_writer"
+
+ # Wait for message from writer process before starting reader(s)
+ Wait-Message $testdir $WRITER_MESSAGE
+ #
+ # Launch the Sparse readers
+ $n = 0
+ $pid_readers = @()
+ Write-Output "launch $Nrdrs_spa swmr_sparse_readers"
+ while ($n -lt $Nrdrs_spa) {
+ # The sparse reader spits out a LOT of data so it's set to 'quiet'
+ $rp = Start-Process -FilePath $testdir/swmr_sparse_reader.exe -NoNewWindow -PassThru -ArgumentList "-q $Nrecs_spa" 2>&1 |tee swmr_reader.out.$n
+ $pid_readers += $rp.id
+ $n += 1
+ }
+ #Write-Output "pid_readers=$pid_readers"
+
+ # Collect exit code of the writer
+ #Write-Output "checked writer $pid_writer"
+ $result = Wait-Process -Id $pid_writer
+ if ($result.ExitCode -ne 0) {
+ Write-Warning "writer had error"
+ $nerrors += 1
+ }
+
+ # Collect exit code of the readers
+ foreach ($xpid in $pid_readers) {
+ #Write-Output "checked reader $xpid"
+ $result = Wait-Process -Id $xpid
+ if ($result.ExitCode -ne 0) {
+ Write-Warning "reader had error"
+ $nerrors += 1
+ }
+ }
+
+ # Check for error and exit if one occurred
+ #Write-Output "nerrors=$nerrors"
+ if ($nerrors -ne 0) {
+ Write-Warning "SWMR tests failed with $nerrors errors."
+ Write-Warning "(Writer and reader output preserved)"
+ exit 1
+ }
+
+ # Clean up output files
+ Remove-Item swmr_writer.out
+ Remove-Item swmr_reader.out.*
+ }
+}
+
+###############################################################################
+## Report and exit
+###############################################################################
+cd ..
+#Write-Output "nerrors=$nerrors"
+if ($nerrors -eq 0) {
+ Write-Output "SWMR tests passed."
+# if test -z "$HDF5_NOCLEANUP"; then
+# # delete the test directory
+# Remove-Item swmr_test -Recurse
+# fi
+ exit 0
+}
+else {
+ Write-Warning "SWMR tests failed with $nerrors errors."
+ exit 1
+}
+
diff --git a/test/testswmr.sh.in b/test/testswmr.sh.in
index 37e8f9c..771fe4a 100644
--- a/test/testswmr.sh.in
+++ b/test/testswmr.sh.in
@@ -17,7 +17,8 @@
# Albert Cheng, 2009/07/22
srcdir=@srcdir@
-bindir=@bindir@
+utils_testdir=@abs_top_builddir@/@H5_UTILS_TEST_BUILDDIR@
+testdir=@abs_top_builddir@/@H5_TEST_BUILDDIR@
###############################################################################
## test parameters
@@ -37,9 +38,9 @@ nerrors=0
## definitions for message file to coordinate test runs
###############################################################################
WRITER_MESSAGE=SWMR_WRITER_MESSAGE # The message file created by writer that the open is complete
- # This should be the same as the define in "./swmr_common.h"
+ # This should be the same as the define in "test/swmr_common.h"
MESSAGE_TIMEOUT=300 # Message timeout length in secs
- # This should be the same as the define in "./h5test.h"
+ # This should be the same as the define in "test/h5test.h"
###############################################################################
## short hands and function definitions
@@ -93,19 +94,10 @@ WAIT_MESSAGE() {
## to proceed as expected.
##
###############################################################################
-# The build (current) directory might be different than the source directory.
-if test -z "$srcdir"; then
- srcdir=.
-fi
-
-# If the bindir directory is not set just use current (.).
-if test -z "$bindir"; then
- bindir=.
-fi
# Check to see if the VFD specified by the HDF5_DRIVER environment variable
# supports SWMR.
-$bindir/swmr_check_compat_vfd
+$utils_testdir/swmr_check_compat_vfd
rc=$?
if [ $rc -ne 0 ] ; then
echo
@@ -178,7 +170,7 @@ do
echo "###############################################################################"
# Launch the Generator without SWMR_WRITE
echo launch the swmr_generator
- $bindir/swmr_generator $compress $index_type
+ $testdir/swmr_generator $compress $index_type
if test $? -ne 0; then
echo generator had error
nerrors=`expr $nerrors + 1`
@@ -186,13 +178,13 @@ do
# Launch the Generator with SWMR_WRITE
echo launch the swmr_generator with SWMR_WRITE
- $bindir/swmr_generator -s $compress $index_type
+ $testdir/swmr_generator -s $compress $index_type
if test $? -ne 0; then
echo generator had error
nerrors=`expr $nerrors + 1`
fi
- # Check for error and exit if one occured
+ # Check for error and exit if one occurred
$DPRINT nerrors=$nerrors
if test $nerrors -ne 0 ; then
echo "SWMR tests failed with $nerrors errors."
@@ -210,7 +202,7 @@ do
# Launch the Writer
echo launch the swmr_start_writer
seed="" # Put -r <random seed> command here
- $bindir/swmr_start_write $compress $index_type $Nrecords $seed 2>&1 |tee swmr_writer.out &
+ $testdir/swmr_start_write $compress $index_type $Nrecords $seed 2>&1 |tee swmr_writer.out &
pid_writer=$!
$DPRINT pid_writer=$pid_writer
@@ -226,7 +218,7 @@ do
while [ $n -lt $Nreaders ]; do
#seed="-r ${seeds[$n]}"
seed=""
- $bindir/swmr_reader $Nsecs_add $seed 2>&1 |tee swmr_reader.out.$n &
+ $testdir/swmr_reader $Nsecs_add $seed 2>&1 |tee swmr_reader.out.$n &
pid_readers="$pid_readers $!"
n=`expr $n + 1`
done
@@ -252,7 +244,7 @@ do
nerrors=`expr $nerrors + 1`
fi
- # Check for error and exit if one occured
+ # Check for error and exit if one occurred
$DPRINT nerrors=$nerrors
if test $nerrors -ne 0 ; then
echo "SWMR tests failed with $nerrors errors."
@@ -271,7 +263,7 @@ do
# Launch the Generator
echo launch the swmr_generator
- $bindir/swmr_generator -s $compress $index_type
+ $testdir/swmr_generator -s $compress $index_type
if test $? -ne 0; then
echo generator had error
nerrors=`expr $nerrors + 1`
@@ -283,7 +275,7 @@ do
# Launch the Writer
echo launch the swmr_writer
seed="" # Put -r <random seed> command here
- $bindir/swmr_writer -o $Nrecords $seed 2>&1 |tee swmr_writer.out &
+ $testdir/swmr_writer -o $Nrecords $seed 2>&1 |tee swmr_writer.out &
pid_writer=$!
$DPRINT pid_writer=$pid_writer
@@ -298,7 +290,7 @@ do
while [ $n -lt $Nreaders ]; do
#seed="-r ${seeds[$n]}"
seed=""
- $bindir/swmr_reader $Nsecs_add $seed 2>&1 |tee swmr_reader.out.$n &
+ $testdir/swmr_reader $Nsecs_add $seed 2>&1 |tee swmr_reader.out.$n &
pid_readers="$pid_readers $!"
n=`expr $n + 1`
done
@@ -324,7 +316,7 @@ do
nerrors=`expr $nerrors + 1`
fi
- # Check for error and exit if one occured
+ # Check for error and exit if one occurred
$DPRINT nerrors=$nerrors
if test $nerrors -ne 0 ; then
echo "SWMR tests failed with $nerrors errors."
@@ -346,7 +338,7 @@ do
# Launch the Remove Writer
echo launch the swmr_remove_writer
seed="" # Put -r <random seed> command here
- $bindir/swmr_remove_writer -o $Nrecs_rem $seed 2>&1 |tee swmr_writer.out &
+ $testdir/swmr_remove_writer -o $Nrecs_rem $seed 2>&1 |tee swmr_writer.out &
pid_writer=$!
$DPRINT pid_writer=$pid_writer
@@ -361,7 +353,7 @@ do
while [ $n -lt $Nreaders ]; do
#seed="-r ${seeds[$n]}"
seed=""
- $bindir/swmr_remove_reader $Nsecs_rem $seed 2>&1 |tee swmr_reader.out.$n &
+ $testdir/swmr_remove_reader $Nsecs_rem $seed 2>&1 |tee swmr_reader.out.$n &
pid_readers="$pid_readers $!"
n=`expr $n + 1`
done
@@ -387,7 +379,7 @@ do
nerrors=`expr $nerrors + 1`
fi
- # Check for error and exit if one occured
+ # Check for error and exit if one occurred
$DPRINT nerrors=$nerrors
if test $nerrors -ne 0 ; then
echo "SWMR tests failed with $nerrors errors."
@@ -406,7 +398,7 @@ do
# Launch the Generator
echo launch the swmr_generator
- $bindir/swmr_generator $compress $index_type
+ $testdir/swmr_generator $compress $index_type
if test $? -ne 0; then
echo generator had error
nerrors=`expr $nerrors + 1`
@@ -415,7 +407,7 @@ do
# Launch the Writer (not in parallel - just to rebuild the datasets)
echo launch the swmr_writer
seed="" # Put -r <random seed> command here
- $bindir/swmr_writer $Nrecords $seed
+ $testdir/swmr_writer $Nrecords $seed
if test $? -ne 0; then
echo writer had error
nerrors=`expr $nerrors + 1`
@@ -427,7 +419,7 @@ do
# Launch the Add/Remove Writer
echo launch the swmr_addrem_writer
seed="" # Put -r <random seed> command here
- $bindir/swmr_addrem_writer $Nrecords $seed 2>&1 |tee swmr_writer.out &
+ $testdir/swmr_addrem_writer $Nrecords $seed 2>&1 |tee swmr_writer.out &
pid_writer=$!
$DPRINT pid_writer=$pid_writer
@@ -442,7 +434,7 @@ do
while [ $n -lt $Nreaders ]; do
#seed="-r ${seeds[$n]}"
seed=""
- $bindir/swmr_remove_reader $Nsecs_addrem $seed 2>&1 |tee swmr_reader.out.$n &
+ $testdir/swmr_remove_reader $Nsecs_addrem $seed 2>&1 |tee swmr_reader.out.$n &
pid_readers="$pid_readers $!"
n=`expr $n + 1`
done
@@ -468,7 +460,7 @@ do
nerrors=`expr $nerrors + 1`
fi
- # Check for error and exit if one occured
+ # Check for error and exit if one occurred
$DPRINT nerrors=$nerrors
if test $nerrors -ne 0 ; then
echo "SWMR tests failed with $nerrors errors."
@@ -490,7 +482,7 @@ do
# created by the generator.
echo launch the swmr_generator
seed="" # Put -r <random seed> command here
- $bindir/swmr_generator $compress $index_type $seed
+ $testdir/swmr_generator $compress $index_type $seed
if test $? -ne 0; then
echo generator had error
nerrors=`expr $nerrors + 1`
@@ -500,7 +492,7 @@ do
rm -f $WRITER_MESSAGE
# Launch the Sparse writer
echo launch the swmr_sparse_writer
- nice -n 20 $bindir/swmr_sparse_writer $Nrecs_spa 2>&1 |tee swmr_writer.out &
+ nice -n 20 $testdir/swmr_sparse_writer $Nrecs_spa 2>&1 |tee swmr_writer.out &
pid_writer=$!
$DPRINT pid_writer=$pid_writer
@@ -513,7 +505,7 @@ do
echo launch $Nrdrs_spa swmr_sparse_readers
while [ $n -lt $Nrdrs_spa ]; do
# The sparse reader spits out a LOT of data so it's set to 'quiet'
- $bindir/swmr_sparse_reader -q $Nrecs_spa 2>&1 |tee swmr_reader.out.$n &
+ $testdir/swmr_sparse_reader -q $Nrecs_spa 2>&1 |tee swmr_reader.out.$n &
pid_readers="$pid_readers $!"
n=`expr $n + 1`
done
@@ -538,7 +530,7 @@ do
fi
done
- # Check for error and exit if one occured
+ # Check for error and exit if one occurred
$DPRINT nerrors=$nerrors
if test $nerrors -ne 0 ; then
echo "SWMR tests failed with $nerrors errors."
diff --git a/test/testvdsswmr.pwsh.in b/test/testvdsswmr.pwsh.in
new file mode 100644
index 0000000..bf5aabb
--- /dev/null
+++ b/test/testvdsswmr.pwsh.in
@@ -0,0 +1,190 @@
+# 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://www.hdfgroup.org/licenses.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+# Tests for the swmr feature using virtual datasets.
+
+$srcdir = '@srcdir@'
+$utils_testdir=@H5_UTILS_TEST_BUILDDIR@
+$testdir=@H5_TEST_BUILDDIR@
+
+###############################################################################
+## test parameters
+###############################################################################
+
+$Nwriters = 6 # number of writers (1 per source dataset)
+$Nreaders = 5 # number of readers to launch
+$nerrors = 0
+
+###############################################################################
+## definitions for message file to coordinate test runs
+###############################################################################
+$WRITER_MESSAGE = 'SWMR_WRITER_MESSAGE' # The message file created by writer that the open is complete
+ # This should be the same as the define in "test/swmr_common.h"
+$MESSAGE_TIMEOUT = 300 # Message timeout length in secs
+ # This should be the same as the define in "test/h5test.h"
+
+# Print a line-line message left justified in a field of 70 characters
+# beginning with the word "Testing".
+#
+function Test-WithSpaces {
+ $SPACES=' '
+ #Write-Output "Testing $* $SPACES" | cut -c1-70 | tr -d '\012'
+}
+
+# To wait for the writer message file or till the maximum # of seconds is reached
+# $Message is the message file to wait for
+# This performs similar function as the routine h5_wait_message() in test/h5test.c
+function Wait-Message {
+ [CmdletBinding()]
+ param (
+ [Parameter(Mandatory, ValueFromPipeline)]
+ [string]$TestPath, # Get the path of the message file to wait for
+ [Parameter(Mandatory, ValueFromPipeline)]
+ [string]$Message # Get the name of the message file to wait for
+ )
+
+ PROCESS {
+ $message = Join-Path -Path $TestPath -ChildPath $Message
+ $t0 = Get-Date # Get current time
+ $t1 = $t0
+ $difft = New-Timespan -Start $t0 -End $t1 # Initialize the time difference
+ $mexist = 0 # Indicate whether the message file is found
+ while ($difft.TotalSeconds -lt $MESSAGE_TIMEOUT) { # Loop till message times out
+ $t1 = Get-Date # Get current time in seconds
+ $difft = New-Timespan -Start $t0 -End $t1 # Calculate the time difference
+ #Write-Output "Check for $message : time=$difft"
+ if ([System.IO.File]::Exists($message)) { # If message file is found:
+ $mexist = 1 # indicate the message file is found
+ Remove-Item $message # remove the message file
+ break # get out of the while loop
+ }
+ }
+ if ($mexist -eq 0) {
+ # Issue warning that the writer message file is not found, continue with launching the reader(s)
+ Write-Warning -Message "$WRITER_MESSAGE is not found after waiting $MESSAGE_TIMEOUT seconds"
+ }
+ else {
+ Write-Output "$WRITER_MESSAGE is found"
+ }
+ }
+}
+
+###############################################################################
+## Main
+###############################################################################
+
+# Check to see if the VFD specified by the HDF5_DRIVER environment variable
+# supports SWMR.
+$testprog = Join-Path -Path $utils_testdir -ChildPath swmr_check_compat_vfd.exe
+$rp = Start-Process -FilePath $testprog -PassThru -Wait -NoNewWindow
+if ($rp.ExitCode -ne 0) {
+ Write-Output ""
+ Write-Output "The VFD specified by the HDF5_DRIVER environment variable"
+ Write-Output "does not support SWMR."
+ Write-Output ""
+ Write-Output "SWMR acceptance tests skipped"
+ Write-Output ""
+ exit 0
+}
+
+Set-Location -Path vds_swmr_test
+$testdir = Join-Path -Path $testdir -ChildPath vds_swmr_test
+
+Write-Output ""
+Write-Output "###############################################################################"
+Write-Output "## Basic VDS SWMR test - writing to a tiled plane"
+Write-Output "###############################################################################"
+
+# Launch the file generator
+Write-Output "launch the swmr_generator"
+$rp = Start-Process -FilePath $testdir/vds_swmr_gen.exe -NoNewWindow -PassThru -Wait
+if ($rp.ExitCode -ne 0) {
+ Write-Warning "generator had error"
+ $nerrors += 1
+}
+
+# Check for error and exit if one occurred
+#Write-Output "nerrors=$nerrors"
+if ($nerrors -ne 0) {
+ Write-Warning "VDS SWMR tests failed with $nerrors errors."
+ exit 1
+}
+
+# Launch the writers
+Write-Output "launch the $Nwriters SWMR VDS writers (1 per source)"
+$pid_writers = @()
+$n = 0
+while ($n -lt $Nwriters) {
+ $rp = Start-Process -FilePath $testdir/vds_swmr_writer.exe -NoNewWindow -PassThru -ArgumentList "$n" 2>&1 | tee swmr_writer.out.$n
+ $pid_writers += $rp.id
+ $n += 1
+}
+#Write-Output "pid_writers=$pid_writers"
+
+# Sleep to ensure that the writers have started
+Start-Sleep -Seconds 3
+
+# Launch the readers
+Write-Output "launch $Nreaders SWMR readers"
+$pid_readers = @()
+$n = 0
+while ($n -lt $Nreaders) {
+ $rp = Start-Process -FilePath $testdir/vds_swmr_reader.exe -NoNewWindow -PassThru 2>&1 | tee swmr_reader.out.$n
+ $pid_readers += $rp.id
+ $n += 1
+}
+#Write-Output "pid_readers=$pid_readers"
+
+# Collect exit code of the writers
+foreach ($xpid in $pid_writers) {
+ #Write-Output "checked writer $xpid"
+ $result = Wait-Process -Id $xpid
+ if ($result.ExitCode -ne 0) {
+ Write-Warning "writer had error"
+ $nerrors += 1
+ }
+}
+
+# Collect exit code of the readers
+# (they usually finish after the writers)
+foreach ($xpid in $pid_readers) {
+ #Write-Output "checked reader $xpid"
+ $result = Wait-Process -Id $xpid
+ if ($result.ExitCode -ne 0) {
+ Write-Warning "reader had error"
+ $nerrors += 1
+ }
+}
+
+# Check for error and exit if one occurred
+#Write-Output "nerrors=$nerrors"
+if ($nerrors -ne 0) {
+ Write-Warning "VDS SWMR tests failed with $nerrors errors."
+ exit 1
+}
+
+###############################################################################
+## Report and exit
+###############################################################################
+cd ..
+#Write-Output "nerrors=$nerrors"
+if ($nerrors -eq 0) {
+ Write-Output "VDS SWMR tests passed."
+# if test -z "$HDF5_NOCLEANUP"; then
+# # delete the test directory
+# Remove-Item vds_swmr_test -Recurse
+# fi
+ exit 0
+}
+else {
+ Write-Warning "VDS SWMR tests failed with $nerrors errors."
+ exit 1
+}
+
diff --git a/test/testvdsswmr.sh.in b/test/testvdsswmr.sh.in
index 5399903..399fdef 100644
--- a/test/testvdsswmr.sh.in
+++ b/test/testvdsswmr.sh.in
@@ -17,7 +17,8 @@
# Dana Robinson, November 2015
srcdir=@srcdir@
-bindir=@bindir@
+utils_testdir=@abs_top_builddir@/@H5_UTILS_TEST_BUILDDIR@
+testdir=@abs_top_builddir@/@H5_TEST_BUILDDIR@
###############################################################################
## test parameters
@@ -31,9 +32,9 @@ nerrors=0
## definitions for message file to coordinate test runs
###############################################################################
WRITER_MESSAGE=SWMR_WRITER_MESSAGE # The message file created by writer that the open is complete
- # This should be the same as the define in "$bindir/swmr_common.h"
+ # This should be the same as the define in "test/swmr_common.h"
MESSAGE_TIMEOUT=300 # Message timeout length in secs
- # This should be the same as the define in "./h5test.h"
+ # This should be the same as the define in "test/h5test.h"
###############################################################################
## short hands and function definitions
@@ -79,19 +80,10 @@ WAIT_MESSAGE() {
###############################################################################
## Main
###############################################################################
-# The build (current) directory might be different than the source directory.
-if test -z "$srcdir"; then
- srcdir=.
-fi
-
-# If the bindir directory is not set just use current (.).
-if test -z "$bindir"; then
- bindir=.
-fi
# Check to see if the VFD specified by the HDF5_DRIVER environment variable
# supports SWMR.
-$bindir/swmr_check_compat_vfd
+$utils_testdir/swmr_check_compat_vfd
rc=$?
if [ $rc -ne 0 ] ; then
echo
@@ -154,13 +146,13 @@ echo "##########################################################################
# Launch the file generator
echo launch the generator
-$bindir/vds_swmr_gen
+$testdir/vds_swmr_gen
if test $? -ne 0; then
echo generator had error
nerrors=`expr $nerrors + 1`
fi
-# Check for error and exit if one occured
+# Check for error and exit if one occurred
$DPRINT nerrors=$nerrors
if test $nerrors -ne 0 ; then
echo "VDS SWMR tests failed with $nerrors errors."
@@ -172,7 +164,7 @@ echo "launch the $Nwriters SWMR VDS writers (1 per source)"
pid_writers=""
n=0
while [ $n -lt $Nwriters ]; do
- $bindir/vds_swmr_writer $n &
+ $testdir/vds_swmr_writer $n &
pid_writers="$pid_writers $!"
n=`expr $n + 1`
done
@@ -187,7 +179,7 @@ echo launch $Nreaders SWMR readers
pid_readers=""
n=0
while [ $n -lt $Nreaders ]; do
- $bindir/vds_swmr_reader &
+ $testdir/vds_swmr_reader &
pid_readers="$pid_readers $!"
n=`expr $n + 1`
done
@@ -215,7 +207,7 @@ for xpid in $pid_readers; do
fi
done
-# Check for error and exit if one occured
+# Check for error and exit if one occurred
$DPRINT nerrors=$nerrors
if test $nerrors -ne 0 ; then
echo "VDS SWMR tests failed with $nerrors errors."
diff --git a/test/testvfdswmr.sh.in b/test/testvfdswmr.sh.in
index a56bf99..88a4ec1 100644
--- a/test/testvfdswmr.sh.in
+++ b/test/testvfdswmr.sh.in
@@ -21,6 +21,8 @@ srcdir=@srcdir@
. ${srcdir}/supervise.subr
+utils_testdir=@abs_top_builddir@/@H5_UTILS_TEST_BUILDDIR@
+
###############################################################################
## test parameters
###############################################################################
@@ -80,6 +82,12 @@ GFAIL_FIFO_WRITER_TO_READER=fifo_group_writer_to_reader
GFAIL_FIFO_READER_TO_WRITER=fifo_group_reader_to_writer
###############################################################################
+## Was the aux process built?
+###############################################################################
+#
+USING_AUX_PROCESS=@AUX_PROCESS@
+
+###############################################################################
## short hands and function definitions
###############################################################################
#
@@ -131,17 +139,15 @@ if test -z "$srcdir"; then
fi
# Check to see if the VFD specified by the HDF5_DRIVER environment variable
-# supports SWMR and/or if we are using parallel HDF5, which does not
-# currently support SWMR.
-./vfd_swmr_check_compat
+# supports SWMR.
+$utils_testdir/swmr_check_compat_vfd
rc=$?
if [ $rc -ne 0 ] ; then
echo
- echo "Either the VFD specified by the HDF5_DRIVER environment variable"
- echo "does not support VFD SWMR or parallel HDF5 was configured, which"
- echo "currently does not support SWMR."
+ echo "The VFD specified by the HDF5_DRIVER environment variable"
+ echo "does not support SWMR."
echo
- echo "VFD SWMR acceptance tests skipped"
+ echo "SWMR acceptance tests skipped"
echo
exit 0
fi
@@ -1075,62 +1081,68 @@ fi
#
#
for options in "-d 1" "-d 1 -F" "-d 2 -l 16" "-d 2 -F -l 16" "-d 1 -t" "-d 1 -t -F" "-d 1 -t -R" "-d 1 -V" "-d 1 -M" "-d 1 -V -F" "-d 1 -M -F"; do
- if [ ${do_many_small:-no} = no ]; then
- continue
- fi
- #
- # Test many small datasets of two or three dimensions.
- #
- # Perform 25 iterations on 100 extensible datasets configured with
- # 2D 16x16 chunks or 3D 1x16x16 chunks of 32-bit unsigned integer elements,
- # expanding each dataset by a chunk in one dimension (up to 25x1
- # 16x16 chunks) on each iteration.
- #
- # Perform the test again, extending each dataset
- # in *two* dimensions (up to 25x25 16x16 chunks).
- #
- # If testing 3D datasets (-t option), extending each dataset along the
- # first dimension (up to 25 1x16x16)
- #
+ if [ ${do_many_small:-no} = no ]; then
+ continue
+ fi
+ #
+ # Test many small datasets of two or three dimensions.
+ #
+ # Perform 25 iterations on 100 extensible datasets configured with
+ # 2D 16x16 chunks or 3D 1x16x16 chunks of 32-bit unsigned integer elements,
+ # expanding each dataset by a chunk in one dimension (up to 25x1
+ # 16x16 chunks) on each iteration.
+ #
+ # Perform the test again, extending each dataset
+ # in *two* dimensions (up to 25x25 16x16 chunks).
+ #
+ # If testing 3D datasets (-t option), extending each dataset along the
+ # first dimension (up to 25 1x16x16)
+ #
- # Launch the auxiliary process for testing NFS if the --enable-aux-process option is enabled for configuration.
- # If it isn't enabled, the auxiliary process simply exit without executing any code. For the testing case of
- # VDS across multiple files (-M option), the program also skips for future support.
+ # Launch the auxiliary process for testing NFS if the --enable-aux-process option is enabled for configuration.
+ # If it isn't enabled, the auxiliary process simply exit without executing any code. For the testing case of
+ # VDS across multiple files (-M option), the program also skips for future support.
+ if test "X$USING_AUX_PROCESS" = "Xyes"; then
if [[ $options == *"-M"* ]]; then
- catch_out_err_and_rc aux_process ../../utils/vfd_swmr/aux_process -a mdfile bigset_updater &
+ catch_out_err_and_rc aux_process ../../utils/vfd_swmr/aux_process -a mdfile bigset_updater &
else
- catch_out_err_and_rc aux_process ../../utils/vfd_swmr/aux_process mdfile bigset_updater &
+ catch_out_err_and_rc aux_process ../../utils/vfd_swmr/aux_process mdfile bigset_updater &
fi
pid_aux_proc=$!
+ fi
- echo launch vfd_swmr_bigset_writer many small, options $options
- catch_out_err_and_rc vfd_swmr_bigset_writer \
- ../vfd_swmr_bigset_writer -n $BIGSET_n $options -s $BIGSET_many_s -e 1 -r 16 -c 16 -q &
- pid_writer=$!
+ echo launch vfd_swmr_bigset_writer many small, options $options
+ catch_out_err_and_rc vfd_swmr_bigset_writer \
+ ../vfd_swmr_bigset_writer -n $BIGSET_n $options -s $BIGSET_many_s -e 1 -r 16 -c 16 -q &
+ pid_writer=$!
- catch_out_err_and_rc vfd_swmr_bigset_reader \
- ../vfd_swmr_bigset_reader -n $BIGSET_n $options -s $BIGSET_many_s -e 1 -r 16 -c 16 -q &
- pid_reader=$!
+ catch_out_err_and_rc vfd_swmr_bigset_reader \
+ ../vfd_swmr_bigset_reader -n $BIGSET_n $options -s $BIGSET_many_s -e 1 -r 16 -c 16 -q &
+ pid_reader=$!
- # Wait for the reader to finish before signalling the
- # writer to quit: the writer holds the file open so that the
- # reader will find the shadow file when it opens
- # the .h5 file. Also wait for the auxiliary process to finish.
+ # Wait for the reader to finish before signalling the
+ # writer to quit: the writer holds the file open so that the
+ # reader will find the shadow file when it opens
+ # the .h5 file. Also wait for the auxiliary process to finish.
+ if test "X$USING_AUX_PROCESS" = "Xyes"; then
wait $pid_aux_proc
- wait $pid_reader
- wait $pid_writer
+ fi
+ wait $pid_reader
+ wait $pid_writer
- # Collect exit code of the auxiliary process
- if [ $(cat aux_process.rc) -ne 0 ]; then
- echo the auxiliary process had error
- nerrors=$((nerrors + 1))
- fi
+ # Collect exit code of the auxiliary process
+ if test "X$USING_AUX_PROCESS" = "Xyes"; then
+ if [ $(cat aux_process.rc) -ne 0 ]; then
+ echo the auxiliary process had error
+ nerrors=$((nerrors + 1))
+ fi
+ fi
- # Collect exit code of the reader
- if [ $(cat vfd_swmr_bigset_reader.rc) -ne 0 ]; then
- echo reader had error
- nerrors=$((nerrors + 1))
- fi
+ # Collect exit code of the reader
+ if [ $(cat vfd_swmr_bigset_reader.rc) -ne 0 ]; then
+ echo reader had error
+ nerrors=$((nerrors + 1))
+ fi
# Collect exit code of the writer
if [ $(cat vfd_swmr_bigset_writer.rc) -ne 0 ]; then
@@ -1139,83 +1151,89 @@ for options in "-d 1" "-d 1 -F" "-d 2 -l 16" "-d 2 -F -l 16" "-d 1 -t" "-d 1 -t
fi
# Clean up output files
- rm -f vfd_swmr_bigset_writer.{out,rc}
- rm -f vfd_swmr_bigset_reader.*.{out,rc}
- rm -f aux_process.{out,rc}
- rm -f mdfile bigset_updater.* bigset-shadow-*
+ rm -f vfd_swmr_bigset_writer.{out,rc}
+ rm -f vfd_swmr_bigset_reader.*.{out,rc}
+ rm -f aux_process.{out,rc}
+ rm -f mdfile bigset_updater.* bigset-shadow-*
done
# bigset test for bigger chunks
for options in "-d 1" "-d 1 -F" "-d 2 -l 10" "-d 2 -F -l 10" "-d 1 -t -l 10" "-d 1 -t -F -l 10" "-d 1 -t -R" "-d 1 -V" "-d 1 -M" "-d 1 -V -F" "-d 1 -M -F"; do
- #
- # Test a few big datasets of two or three dimensions.
- #
- # Perform 25 iterations on 10 extensible datasets configured with
- # 2D 256x256 chunks or 3D 8x256x256 of 32-bit unsigned integer elements,
- # expanding each dataset by a chunk in one dimension (up to 25x1
- # 256x256 chunks) on each iteration.
- #
- # Perform the test again, extending each dataset
- # in *two* dimensions (up to 25x25 256x256 chunks).
- #
- # If testing 3D datasets (-t option), extending each dataset along the
- # first dimension (up to 25 8x256x256)
- #
+ #
+ # Test a few big datasets of two or three dimensions.
+ #
+ # Perform 25 iterations on 10 extensible datasets configured with
+ # 2D 256x256 chunks or 3D 8x256x256 of 32-bit unsigned integer elements,
+ # expanding each dataset by a chunk in one dimension (up to 25x1
+ # 256x256 chunks) on each iteration.
+ #
+ # Perform the test again, extending each dataset
+ # in *two* dimensions (up to 25x25 256x256 chunks).
+ #
+ # If testing 3D datasets (-t option), extending each dataset along the
+ # first dimension (up to 25 8x256x256)
+ #
- if [ ${do_few_big:-no} = no ]; then
- continue
- fi
- echo launch vfd_swmr_bigset_writer few big, options $options ......may take some time......
+ if [ ${do_few_big:-no} = no ]; then
+ continue
+ fi
+ echo launch vfd_swmr_bigset_writer few big, options $options ......may take some time......
- # Launch the auxiliary process for testing NFS if the --enable-aux-process option is enabled for configuration.
- # If it isn't enabled, the auxiliary process simply exit without executing any code. For the testing case of
- # VDS across multiple files (-M option), the program also skips for future support.
+ # Launch the auxiliary process for testing NFS if the --enable-aux-process option is enabled for configuration.
+ # If it isn't enabled, the auxiliary process simply exit without executing any code. For the testing case of
+ # VDS across multiple files (-M option), the program also skips for future support.
+ if test "X$USING_AUX_PROCESS" = "Xyes"; then
if [[ $options == *"-M"* ]]; then
- catch_out_err_and_rc aux_process ../../utils/vfd_swmr/aux_process -a mdfile bigset_updater &
+ catch_out_err_and_rc aux_process ../../utils/vfd_swmr/aux_process -a mdfile bigset_updater &
else
- catch_out_err_and_rc aux_process ../../utils/vfd_swmr/aux_process mdfile bigset_updater &
+ catch_out_err_and_rc aux_process ../../utils/vfd_swmr/aux_process mdfile bigset_updater &
fi
pid_aux_proc=$!
+ fi
- catch_out_err_and_rc vfd_swmr_bigset_writer \
- ../vfd_swmr_bigset_writer -n $BIGSET_n $options -s $BIGSET_few_s -e 8 -r 256 -c 256 -q &
- pid_writer=$!
+ catch_out_err_and_rc vfd_swmr_bigset_writer \
+ ../vfd_swmr_bigset_writer -n $BIGSET_n $options -s $BIGSET_few_s -e 8 -r 256 -c 256 -q &
+ pid_writer=$!
- catch_out_err_and_rc vfd_swmr_bigset_reader \
- ../vfd_swmr_bigset_reader -n $BIGSET_n $options -s $BIGSET_few_s -e 8 -r 256 -c 256 -q &
- pid_reader=$!
+ catch_out_err_and_rc vfd_swmr_bigset_reader \
+ ../vfd_swmr_bigset_reader -n $BIGSET_n $options -s $BIGSET_few_s -e 8 -r 256 -c 256 -q &
+ pid_reader=$!
- # Wait for the reader to finish before signalling the
- # writer to quit: the writer holds the file open so that the
- # reader will find the shadow file when it opens
- # the .h5 file. Also wait for the auxiliary process to finish.
+ # Wait for the reader to finish before signalling the
+ # writer to quit: the writer holds the file open so that the
+ # reader will find the shadow file when it opens
+ # the .h5 file. Also wait for the auxiliary process to finish.
+ if test "X$USING_AUX_PROCESS" = "Xyes"; then
wait $pid_aux_proc
- wait $pid_reader
- wait $pid_writer
+ fi
+ wait $pid_reader
+ wait $pid_writer
# Collect exit code of the auxiliary process
- if [ $(cat aux_process.rc) -ne 0 ]; then
- echo the auxiliary process had error
- nerrors=$((nerrors + 1))
- fi
+ if test "X$USING_AUX_PROCESS" = "Xyes"; then
+ if [ $(cat aux_process.rc) -ne 0 ]; then
+ echo the auxiliary process had error
+ nerrors=$((nerrors + 1))
+ fi
+ fi
- # Collect exit code of the reader
- if [ $(cat vfd_swmr_bigset_reader.rc) -ne 0 ]; then
- echo reader had error
- nerrors=$((nerrors + 1))
- fi
+ # Collect exit code of the reader
+ if [ $(cat vfd_swmr_bigset_reader.rc) -ne 0 ]; then
+ echo reader had error
+ nerrors=$((nerrors + 1))
+ fi
- # Collect exit code of the writer
- if [ $(cat vfd_swmr_bigset_writer.rc) -ne 0 ]; then
- echo writer had error
- nerrors=$((nerrors + 1))
- fi
+ # Collect exit code of the writer
+ if [ $(cat vfd_swmr_bigset_writer.rc) -ne 0 ]; then
+ echo writer had error
+ nerrors=$((nerrors + 1))
+ fi
- # Clean up output files
- rm -f vfd_swmr_bigset_writer.{out,rc}
- rm -f vfd_swmr_bigset_reader.*.{out,rc}
- rm -f aux_process.{out,rc}
- rm -f mdfile bigset_updater.* bigset-shadow-*
+ # Clean up output files
+ rm -f vfd_swmr_bigset_writer.{out,rc}
+ rm -f vfd_swmr_bigset_reader.*.{out,rc}
+ rm -f aux_process.{out,rc}
+ rm -f mdfile bigset_updater.* bigset-shadow-*
done
###############################################################################
@@ -1563,7 +1581,7 @@ fi
# Only for exhaustive run
#
# Verify that meaningful message about increasing max_lag is printed when
-# incorrect metadata checksum error is enountered when loading the cache entry.
+# incorrect metadata checksum error is encountered when loading the cache entry.
#
# Note that there will be messages from the error stack printed out for this test.
# This is expected.
diff --git a/test/tfile.c b/test/tfile.c
index 656e956..31a9581 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -35,6 +35,10 @@
#define H5F_TESTING
#include "H5Fpkg.h" /* File access */
+#define H5FD_FRIEND /*suppress error about including H5FDpkg.h */
+#define H5FD_TESTING
+#include "H5FDpkg.h"
+
#define H5D_FRIEND /*suppress error about including H5Dpkg */
#include "H5Dpkg.h" /* Dataset access */
@@ -176,8 +180,8 @@ const char *FILESPACE_NAME[] = {"tfilespace", NULL};
#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_low_high(const char *env_h5_drvr);
+static void test_libver_bounds_super(hid_t fapl, const char *env_h5_drvr);
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);
@@ -210,11 +214,11 @@ 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 */
+ 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 */
@@ -225,7 +229,7 @@ test_file_create(void)
/* First ensure the file does not exist */
HDremove(FILE1);
- /* Try opening a non-existant file */
+ /* Try opening a non-existent file */
fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
VERIFY(fid1, FAIL, "H5Fopen");
@@ -304,186 +308,189 @@ test_file_create(void)
VERIFY(ret, FAIL, "H5Pclose");
#endif
- /* Create a new file with a non-standard file-creation template */
- tmpl1 = H5Pcreate(H5P_FILE_CREATE);
- CHECK(tmpl1, FAIL, "H5Pcreate");
+ if (h5_using_default_driver(NULL)) {
- /* Try setting some bad userblock sizes */
- H5E_BEGIN_TRY
- {
- ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE1);
- }
- H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Pset_userblock");
- H5E_BEGIN_TRY
- {
- ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE2);
- }
- H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Pset_userblock");
- H5E_BEGIN_TRY
- {
- ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE3);
- }
- H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Pset_userblock");
- H5E_BEGIN_TRY
- {
- ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE4);
- }
- H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Pset_userblock");
- H5E_BEGIN_TRY
- {
- ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE5);
- }
- H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Pset_userblock");
- H5E_BEGIN_TRY
- {
- ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE6);
- }
- H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Pset_userblock");
- H5E_BEGIN_TRY
- {
- ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE7);
- }
- H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Pset_userblock");
-
- /* Set the new file-creation parameters */
- ret = H5Pset_userblock(tmpl1, F2_USERBLOCK_SIZE);
- CHECK(ret, FAIL, "H5Pset_userblock");
+ /* Create a new file with a non-standard file-creation template */
+ tmpl1 = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(tmpl1, FAIL, "H5Pcreate");
- ret = H5Pset_sizes(tmpl1, (size_t)F2_OFFSET_SIZE, (size_t)F2_LENGTH_SIZE);
- CHECK(ret, FAIL, "H5Pset_sizes");
-
- ret = H5Pset_sym_k(tmpl1, F2_SYM_INTERN_K, F2_SYM_LEAF_K);
- CHECK(ret, FAIL, "H5Pset_sym_k");
+ /* Try setting some bad userblock sizes */
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE1);
+ }
+ H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Pset_userblock");
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE2);
+ }
+ H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Pset_userblock");
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE3);
+ }
+ H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Pset_userblock");
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE4);
+ }
+ H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Pset_userblock");
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE5);
+ }
+ H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Pset_userblock");
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE6);
+ }
+ H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Pset_userblock");
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE7);
+ }
+ H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Pset_userblock");
- /*
- * Try to create second file, with non-standard file-creation template
- * params.
- */
- fid2 = H5Fcreate(FILE2, H5F_ACC_TRUNC, tmpl1, H5P_DEFAULT);
- CHECK(fid2, FAIL, "H5Fcreate");
+ /* Set the new file-creation parameters */
+ ret = H5Pset_userblock(tmpl1, F2_USERBLOCK_SIZE);
+ CHECK(ret, FAIL, "H5Pset_userblock");
- /* Release file-creation template */
- ret = H5Pclose(tmpl1);
- CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Pset_sizes(tmpl1, (size_t)F2_OFFSET_SIZE, (size_t)F2_LENGTH_SIZE);
+ CHECK(ret, FAIL, "H5Pset_sizes");
- /* Make certain we can create a dataset properly in the file with the userblock */
- {
- hid_t dataset_id, dataspace_id; /* identifiers */
- hsize_t dims[F2_RANK];
- unsigned data[F2_DIM0][F2_DIM1];
- unsigned i, j;
+ ret = H5Pset_sym_k(tmpl1, F2_SYM_INTERN_K, F2_SYM_LEAF_K);
+ CHECK(ret, FAIL, "H5Pset_sym_k");
- /* Create the data space for the dataset. */
- dims[0] = F2_DIM0;
- dims[1] = F2_DIM1;
- dataspace_id = H5Screate_simple(F2_RANK, dims, NULL);
- CHECK(dataspace_id, FAIL, "H5Screate_simple");
+ /*
+ * Try to create second file, with non-standard file-creation template
+ * params.
+ */
+ fid2 = H5Fcreate(FILE2, H5F_ACC_TRUNC, tmpl1, H5P_DEFAULT);
+ CHECK(fid2, FAIL, "H5Fcreate");
- /* Create the dataset. */
- dataset_id =
- H5Dcreate2(fid2, F2_DSET, H5T_NATIVE_UINT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dataset_id, FAIL, "H5Dcreate2");
+ /* Release file-creation template */
+ ret = H5Pclose(tmpl1);
+ CHECK(ret, FAIL, "H5Pclose");
- for (i = 0; i < F2_DIM0; i++)
- for (j = 0; j < F2_DIM1; j++)
- data[i][j] = i * 10 + j;
+ /* Make certain we can create a dataset properly in the file with the userblock */
+ {
+ hid_t dataset_id, dataspace_id; /* identifiers */
+ hsize_t dims[F2_RANK];
+ unsigned data[F2_DIM0][F2_DIM1];
+ unsigned i, j;
+
+ /* Create the data space for the dataset. */
+ dims[0] = F2_DIM0;
+ dims[1] = F2_DIM1;
+ dataspace_id = H5Screate_simple(F2_RANK, dims, NULL);
+ CHECK(dataspace_id, FAIL, "H5Screate_simple");
+
+ /* Create the dataset. */
+ dataset_id = H5Dcreate2(fid2, F2_DSET, H5T_NATIVE_UINT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT,
+ H5P_DEFAULT);
+ CHECK(dataset_id, FAIL, "H5Dcreate2");
+
+ for (i = 0; i < F2_DIM0; i++)
+ for (j = 0; j < F2_DIM1; j++)
+ data[i][j] = i * 10 + j;
+
+ /* Write data to the new dataset */
+ ret = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* End access to the dataset and release resources used by it. */
+ ret = H5Dclose(dataset_id);
+ CHECK(ret, FAIL, "H5Dclose");
- /* Write data to the new dataset */
- ret = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
- CHECK(ret, FAIL, "H5Dwrite");
+ /* Terminate access to the data space. */
+ ret = H5Sclose(dataspace_id);
+ CHECK(ret, FAIL, "H5Sclose");
+ }
- /* End access to the dataset and release resources used by it. */
- ret = H5Dclose(dataset_id);
- CHECK(ret, FAIL, "H5Dclose");
+ /* Get the file-creation template */
+ tmpl1 = H5Fget_create_plist(fid2);
+ CHECK(tmpl1, FAIL, "H5Fget_create_plist");
- /* Terminate access to the data space. */
- ret = H5Sclose(dataspace_id);
- CHECK(ret, FAIL, "H5Sclose");
- }
+ /* Get the file-creation parameters */
+ ret = H5Pget_userblock(tmpl1, &ublock);
+ CHECK(ret, FAIL, "H5Pget_userblock");
+ VERIFY(ublock, F2_USERBLOCK_SIZE, "H5Pget_userblock");
- /* Get the file-creation template */
- tmpl1 = H5Fget_create_plist(fid2);
- CHECK(tmpl1, FAIL, "H5Fget_create_plist");
+ ret = H5Pget_sizes(tmpl1, &parm, &parm2);
+ CHECK(ret, FAIL, "H5Pget_sizes");
+ VERIFY(parm, F2_OFFSET_SIZE, "H5Pget_sizes");
+ VERIFY(parm2, F2_LENGTH_SIZE, "H5Pget_sizes");
- /* Get the file-creation parameters */
- ret = H5Pget_userblock(tmpl1, &ublock);
- CHECK(ret, FAIL, "H5Pget_userblock");
- VERIFY(ublock, F2_USERBLOCK_SIZE, "H5Pget_userblock");
+ ret = H5Pget_sym_k(tmpl1, &iparm, &iparm2);
+ CHECK(ret, FAIL, "H5Pget_sym_k");
+ VERIFY(iparm, F2_SYM_INTERN_K, "H5Pget_sym_k");
+ VERIFY(iparm2, F2_SYM_LEAF_K, "H5Pget_sym_k");
- ret = H5Pget_sizes(tmpl1, &parm, &parm2);
- CHECK(ret, FAIL, "H5Pget_sizes");
- VERIFY(parm, F2_OFFSET_SIZE, "H5Pget_sizes");
- VERIFY(parm2, F2_LENGTH_SIZE, "H5Pget_sizes");
+ /* Clone the file-creation template */
+ tmpl2 = H5Pcopy(tmpl1);
+ CHECK(tmpl2, FAIL, "H5Pcopy");
- ret = H5Pget_sym_k(tmpl1, &iparm, &iparm2);
- CHECK(ret, FAIL, "H5Pget_sym_k");
- VERIFY(iparm, F2_SYM_INTERN_K, "H5Pget_sym_k");
- VERIFY(iparm2, F2_SYM_LEAF_K, "H5Pget_sym_k");
+ /* Release file-creation template */
+ ret = H5Pclose(tmpl1);
+ CHECK(ret, FAIL, "H5Pclose");
- /* Clone the file-creation template */
- tmpl2 = H5Pcopy(tmpl1);
- CHECK(tmpl2, FAIL, "H5Pcopy");
+ /* Set the new file-creation parameter */
+ ret = H5Pset_userblock(tmpl2, F3_USERBLOCK_SIZE);
+ CHECK(ret, FAIL, "H5Pset_userblock");
- /* Release file-creation template */
- ret = H5Pclose(tmpl1);
- CHECK(ret, FAIL, "H5Pclose");
+ /*
+ * Try to create second file, with non-standard file-creation template
+ * params
+ */
+ fid3 = H5Fcreate(FILE3, H5F_ACC_TRUNC, tmpl2, H5P_DEFAULT);
+ CHECK(fid3, FAIL, "H5Fcreate");
- /* Set the new file-creation parameter */
- ret = H5Pset_userblock(tmpl2, F3_USERBLOCK_SIZE);
- CHECK(ret, FAIL, "H5Pset_userblock");
+ /* Release file-creation template */
+ ret = H5Pclose(tmpl2);
+ CHECK(ret, FAIL, "H5Pclose");
- /*
- * Try to create second file, with non-standard file-creation template
- * params
- */
- fid3 = H5Fcreate(FILE3, H5F_ACC_TRUNC, tmpl2, H5P_DEFAULT);
- CHECK(fid3, FAIL, "H5Fcreate");
+ /* Get the file-creation template */
+ tmpl1 = H5Fget_create_plist(fid3);
+ CHECK(tmpl1, FAIL, "H5Fget_create_plist");
- /* Release file-creation template */
- ret = H5Pclose(tmpl2);
- CHECK(ret, FAIL, "H5Pclose");
+ /* Get the file-creation parameters */
+ ret = H5Pget_userblock(tmpl1, &ublock);
+ CHECK(ret, FAIL, "H5Pget_userblock");
+ VERIFY(ublock, F3_USERBLOCK_SIZE, "H5Pget_userblock");
- /* Get the file-creation template */
- tmpl1 = H5Fget_create_plist(fid3);
- CHECK(tmpl1, FAIL, "H5Fget_create_plist");
+ ret = H5Pget_sizes(tmpl1, &parm, &parm2);
+ CHECK(ret, FAIL, "H5Pget_sizes");
+ VERIFY(parm, F3_OFFSET_SIZE, "H5Pget_sizes");
+ VERIFY(parm2, F3_LENGTH_SIZE, "H5Pget_sizes");
- /* Get the file-creation parameters */
- ret = H5Pget_userblock(tmpl1, &ublock);
- CHECK(ret, FAIL, "H5Pget_userblock");
- VERIFY(ublock, F3_USERBLOCK_SIZE, "H5Pget_userblock");
+ ret = H5Pget_sym_k(tmpl1, &iparm, &iparm2);
+ CHECK(ret, FAIL, "H5Pget_sym_k");
+ VERIFY(iparm, F3_SYM_INTERN_K, "H5Pget_sym_k");
+ VERIFY(iparm2, F3_SYM_LEAF_K, "H5Pget_sym_k");
- ret = H5Pget_sizes(tmpl1, &parm, &parm2);
- CHECK(ret, FAIL, "H5Pget_sizes");
- VERIFY(parm, F3_OFFSET_SIZE, "H5Pget_sizes");
- VERIFY(parm2, F3_LENGTH_SIZE, "H5Pget_sizes");
+ /* Release file-creation template */
+ ret = H5Pclose(tmpl1);
+ CHECK(ret, FAIL, "H5Pclose");
- ret = H5Pget_sym_k(tmpl1, &iparm, &iparm2);
- CHECK(ret, FAIL, "H5Pget_sym_k");
- VERIFY(iparm, F3_SYM_INTERN_K, "H5Pget_sym_k");
- VERIFY(iparm2, F3_SYM_LEAF_K, "H5Pget_sym_k");
+ /* Close second file */
+ ret = H5Fclose(fid2);
+ CHECK(ret, FAIL, "H5Fclose");
- /* Release file-creation template */
- ret = H5Pclose(tmpl1);
- CHECK(ret, FAIL, "H5Pclose");
+ /* Close third file */
+ ret = H5Fclose(fid3);
+ CHECK(ret, FAIL, "H5Fclose");
+ }
/* Close first file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
-
- /* Close second file */
- ret = H5Fclose(fid2);
- CHECK(ret, FAIL, "H5Fclose");
-
- /* Close third file */
- ret = H5Fclose(fid3);
- CHECK(ret, FAIL, "H5Fclose");
} /* test_file_create() */
/****************************************************************
@@ -492,7 +499,7 @@ test_file_create(void)
**
****************************************************************/
static void
-test_file_open(void)
+test_file_open(const char *env_h5_drvr)
{
hid_t fid1, fid2; /*HDF5 File IDs */
hid_t did; /*dataset ID */
@@ -510,6 +517,10 @@ test_file_open(void)
* Test single file open
*/
+ /* Only run this test with sec2/default driver */
+ if (!h5_using_default_driver(env_h5_drvr))
+ return;
+
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File Opening I/O\n"));
@@ -1619,22 +1630,24 @@ test_file_perm2(void)
** H5Fis_accessible() API call.
**
*****************************************************************/
-#define FILE_IS_ACCESSIBLE "tfile_is_accessible"
+#define FILE_IS_ACCESSIBLE "tfile_is_accessible"
+#define FILE_IS_ACCESSIBLE_NON_HDF5 "tfile_is_accessible_non_hdf5"
static void
test_file_is_accessible(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 */
+ 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 non_hdf5_filename[FILENAME_LEN]; /* Base name of non-hdf5 file */
+ char non_hdf5_sb_filename[FILENAME_LEN]; /* Name of non-hdf5 superblock file */
+ 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"));
@@ -1643,13 +1656,11 @@ test_file_is_accessible(const char *env_h5_drvr)
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().
- */
+ /* Fix up filenames */
h5_fixname(FILE_IS_ACCESSIBLE, fapl_id, filename, sizeof(filename));
- h5_fixname_superblock(FILE_IS_ACCESSIBLE, fapl_id, sb_filename, sizeof(filename));
+ h5_fixname(FILE_IS_ACCESSIBLE_NON_HDF5, fapl_id, non_hdf5_filename, sizeof(non_hdf5_filename));
+ h5_fixname_superblock(FILE_IS_ACCESSIBLE_NON_HDF5, fapl_id, non_hdf5_sb_filename,
+ sizeof(non_hdf5_sb_filename));
/****************/
/* Normal usage */
@@ -1727,48 +1738,54 @@ test_file_is_accessible(const char *env_h5_drvr)
VERIFY(is_hdf5, TRUE, "H5Fis_accessible");
} /* end if */
- /***********************/
- /* EMPTY non-HDF5 file */
- /***********************/
+ /* Don't run the below tests for drivers that use multiple
+ * logical files, like the splitter driver.
+ */
+ if (!h5_driver_uses_multiple_files(env_h5_drvr, H5_EXCLUDE_MULTIPART_DRIVERS)) {
+ /***********************/
+ /* 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");
+ /* Create non-HDF5 file and check it */
+ fd = HDopen(non_hdf5_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");
+ /* 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)");
+ /* Verify that the file is NOT an HDF5 file using the base filename */
+ is_hdf5 = H5Fis_accessible(non_hdf5_filename, fapl_id);
+ VERIFY(is_hdf5, FALSE, "H5Fis_accessible (empty non-HDF5 file)");
- /***************************/
- /* Non-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");
+ /* Create non-HDF5 file and check it */
+ fd = HDopen(non_hdf5_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;
+ /* 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");
+ /* 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");
+ /* 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)");
+ /* Verify that the file is not an HDF5 file */
+ is_hdf5 = H5Fis_accessible(non_hdf5_filename, fapl_id);
+ VERIFY(is_hdf5, FALSE, "H5Fis_accessible (non-HDF5 file)");
+ }
/* Clean up files */
h5_delete_test_file(filename, fapl_id);
+ h5_delete_test_file(non_hdf5_filename, fapl_id);
/* Close property list */
ret = H5Pclose(fapl_id);
@@ -1780,7 +1797,7 @@ test_file_is_accessible(const char *env_h5_drvr)
**
** test_file_ishdf5(): low-level file test routine.
** This test checks whether the H5Fis_hdf5() routine is working
-** correctly in variuous situations.
+** correctly in various situations.
**
*****************************************************************/
#ifndef H5_NO_DEPRECATED_SYMBOLS
@@ -1800,6 +1817,9 @@ test_file_ishdf5(const char *env_h5_drvr)
int posix_ret; /* Return value from POSIX calls */
herr_t ret; /* Return value from HDF5 calls */
+ if (!h5_using_default_driver(env_h5_drvr))
+ return;
+
/* Output message about test being performed */
MESSAGE(5, ("Testing Detection of HDF5 Files (using deprecated H5Fis_hdf5() call)\n"));
@@ -1835,33 +1855,28 @@ test_file_ishdf5(const char *env_h5_drvr)
/* Non-default user block size */
/*******************************/
- /* 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");
+ /* 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");
+ 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");
+ /* 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");
+ /* Release file creation property list */
+ ret = H5Pclose(fcpl_id);
+ CHECK(ret, FAIL, "H5Pclose");
- /* Close file */
- ret = H5Fclose(fid);
- CHECK(ret, FAIL, "H5Fclose");
+ /* 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 */
+ /* Verify that the file is an HDF5 file */
+ is_hdf5 = H5Fis_hdf5(sb_filename);
+ VERIFY(is_hdf5, TRUE, "H5Fis_hdf5");
/***************************/
/* Non-empty non-HDF5 file */
@@ -2001,7 +2016,7 @@ test_file_delete(hid_t fapl_id)
**
** test_file_open_dot(): low-level file test routine.
** This test checks whether opening objects with "." for a name
-** works correctly in variuous situations.
+** works correctly in various situations.
**
*****************************************************************/
static void
@@ -2383,7 +2398,7 @@ test_file_double_root_open(void)
grp2_id = H5Gopen2(file2_id, "/", H5P_DEFAULT);
CHECK(grp2_id, FAIL, "H5Gopen2");
- /* Note "assymetric" close order */
+ /* Note "asymmetric" close order */
ret = H5Gclose(grp1_id);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(grp2_id);
@@ -2422,7 +2437,7 @@ test_file_double_group_open(void)
grp2_id = H5Gopen2(file2_id, GRP_NAME, H5P_DEFAULT);
CHECK(grp2_id, FAIL, "H5Gopen2");
- /* Note "assymetric" close order */
+ /* Note "asymmetric" close order */
ret = H5Gclose(grp1_id);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(grp2_id);
@@ -2471,7 +2486,7 @@ test_file_double_dataset_open(void)
ret = H5Sclose(space_id);
CHECK(ret, FAIL, "H5Sclose");
- /* Note "assymetric" close order */
+ /* Note "asymmetric" close order */
ret = H5Dclose(dset1_id);
CHECK(ret, FAIL, "H5Dclose");
ret = H5Dclose(dset2_id);
@@ -2872,7 +2887,7 @@ test_file_double_datatype_open(void)
type2_id = H5Topen2(file2_id, TYPE_NAME, H5P_DEFAULT);
CHECK(type2_id, FAIL, "H5Topen2");
- /* Note "assymetric" close order */
+ /* Note "asymmetric" close order */
ret = H5Tclose(type1_id);
CHECK(ret, FAIL, "H5Tclose");
ret = H5Tclose(type2_id);
@@ -2896,7 +2911,7 @@ test_file_double_datatype_open(void)
**
*****************************************************************/
static void
-test_userblock_file_size(void)
+test_userblock_file_size(const char *env_h5_drvr)
{
hid_t file1_id, file2_id;
hid_t group1_id, group2_id;
@@ -2908,6 +2923,11 @@ test_userblock_file_size(void)
unsigned long fileno1, fileno2; /* File number */
herr_t ret; /* Generic return value */
+ /* Don't run with multi/split, family or direct drivers */
+ if (!HDstrcmp(env_h5_drvr, "multi") || !HDstrcmp(env_h5_drvr, "split") ||
+ !HDstrcmp(env_h5_drvr, "family") || !HDstrcmp(env_h5_drvr, "direct"))
+ return;
+
/* Output message about test being performed */
MESSAGE(5, ("Testing file size with user block\n"));
@@ -2917,7 +2937,7 @@ test_userblock_file_size(void)
ret = H5Pset_userblock(fcpl2_id, USERBLOCK_SIZE);
CHECK(ret, FAIL, "H5Pset_userblock");
- /* Create files. Onyl file2 with have a userblock. */
+ /* Create files. Only file2 with have a userblock. */
file1_id = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file1_id, FAIL, "H5Fcreate");
file2_id = H5Fcreate(FILE2, H5F_ACC_TRUNC, fcpl2_id, H5P_DEFAULT);
@@ -3294,13 +3314,17 @@ test_userblock_alignment_helper2(hid_t fapl, hbool_t open_rw)
**
*****************************************************************/
static void
-test_userblock_alignment(void)
+test_userblock_alignment(const char *env_h5_drvr)
{
hid_t fid; /* File ID */
hid_t fcpl; /* File creation property list ID */
hid_t fapl; /* File access property list ID */
herr_t ret; /* Generic return value */
+ /* Only run with sec2 driver */
+ if (!h5_using_default_driver(env_h5_drvr))
+ return;
+
/* Output message about test being performed */
MESSAGE(5, ("Testing that non-zero userblocks and object alignment interact correctly.\n"));
@@ -3512,13 +3536,17 @@ test_userblock_alignment(void)
**
*****************************************************************/
static void
-test_userblock_alignment_paged(void)
+test_userblock_alignment_paged(const char *env_h5_drvr)
{
hid_t fid; /* File ID */
hid_t fcpl; /* File creation property list ID */
hid_t fapl; /* File access property list ID */
herr_t ret; /* Generic return value */
+ /* Only run with sec2 driver */
+ if (!h5_using_default_driver(env_h5_drvr))
+ return;
+
/* Output message about test being performed */
MESSAGE(5, ("Testing interaction between userblock and alignment (via paged aggregation and "
"H5Pset_alignment)\n"));
@@ -3838,7 +3866,7 @@ test_userblock_alignment_paged(void)
* Strategy is H5F_FILE_SPACE_NONE; fsp_size = 1024
* H5Pset_alignment() is 16
* Outcome:
- * Should succed:
+ * Should succeed:
* userblock (512) is integral multiple of alignment (16)
*/
/* Create file creation property list with user block */
@@ -3877,7 +3905,7 @@ test_userblock_alignment_paged(void)
* H5Pset_alignment() is 3
* Reopen the file; H5Pset_alignment() is 1024
* Outcome:
- * Should succed:
+ * Should succeed:
* Userblock (512) is the same as alignment (512);
* The H5Pset_alignment() calls have no effect
*/
@@ -3946,7 +3974,7 @@ test_filespace_info(const char *env_h5_drvr)
hsize_t fs_threshold; /* Free-space section threshold--iteration variable */
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 */
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contiguous address space */
herr_t ret; /* Return value */
/* Output message about test being performed */
@@ -5188,7 +5216,7 @@ test_filespace_1_10_0_compatible(void)
** 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.
+** threshold, and file spacing paging enabled/disabled.
** 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
@@ -5575,7 +5603,10 @@ test_libver_bounds(void)
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();
+
+ if (!h5_driver_uses_modified_filename()) {
+ test_libver_bounds_copy();
+ }
} /* end test_libver_bounds() */
/**************************************************************************************
@@ -5600,7 +5631,7 @@ test_libver_bounds(void)
**
**************************************************************************************/
static void
-test_libver_bounds_low_high(void)
+test_libver_bounds_low_high(const char *env_h5_drvr)
{
hid_t fapl = H5I_INVALID_HID; /* File access property list */
H5F_libver_t low, high; /* Low and high bounds */
@@ -5640,7 +5671,7 @@ test_libver_bounds_low_high(void)
VERIFY(ret, SUCCEED, "H5Pset_libver_bounds");
/* Tests to verify version bounds */
- test_libver_bounds_super(fapl);
+ test_libver_bounds_super(fapl, env_h5_drvr);
test_libver_bounds_obj(fapl);
test_libver_bounds_dataset(fapl);
test_libver_bounds_dataspace(fapl);
@@ -5673,7 +5704,7 @@ test_libver_bounds_low_high(void)
**
*************************************************************************/
static void
-test_libver_bounds_super(hid_t fapl)
+test_libver_bounds_super(hid_t fapl, const char *env_h5_drvr)
{
hid_t fcpl = H5I_INVALID_HID; /* File creation property list */
herr_t ret; /* The return value */
@@ -5685,12 +5716,14 @@ test_libver_bounds_super(hid_t fapl)
/* 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);
+ if (H5FD__supports_swmr_test(env_h5_drvr))
+ 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);
+ if (H5FD__supports_swmr_test(env_h5_drvr))
+ test_libver_bounds_super_open(fapl, fcpl, TRUE, FALSE);
test_libver_bounds_super_open(fapl, fcpl, FALSE, FALSE);
/* Close the fcpl */
@@ -5706,12 +5739,14 @@ test_libver_bounds_super(hid_t fapl)
/* 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);
+ if (H5FD__supports_swmr_test(env_h5_drvr))
+ 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);
+ if (H5FD__supports_swmr_test(env_h5_drvr))
+ test_libver_bounds_super_open(fapl, fcpl, TRUE, FALSE);
test_libver_bounds_super_open(fapl, fcpl, FALSE, FALSE);
/* Close the fcpl */
@@ -5729,38 +5764,44 @@ test_libver_bounds_super(hid_t fapl)
/* 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);
+ if (H5FD__supports_swmr_test(env_h5_drvr))
+ 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);
+ if (H5FD__supports_swmr_test(env_h5_drvr))
+ 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");
+ if (h5_using_default_driver(env_h5_drvr)) {
+ /* 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 */
+ if (H5FD__supports_swmr_test(env_h5_drvr))
+ 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 */
+ if (H5FD__supports_swmr_test(env_h5_drvr))
+ 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() */
@@ -6349,7 +6390,7 @@ test_libver_bounds_dataset(hid_t fapl)
VERIFY(dset->shared->dcpl_cache.fill.version, H5O_fill_ver_bounds[low], "H5O_fill_ver_bounds");
}
- /* Verify filter pipleline message version */
+ /* Verify filter pipeline message version */
VERIFY(dset->shared->dcpl_cache.pline.version, H5O_pline_ver_bounds[low], "H5O_pline_ver_bounds");
/* Close the dataset */
@@ -6402,7 +6443,7 @@ test_libver_bounds_dataset(hid_t fapl)
ret = H5Sclose(sid);
CHECK(ret, FAIL, "H5Sclose");
- /* Close the datset creation property list */
+ /* Close the dataset creation property list */
ret = H5Pclose(dcpl);
CHECK(ret, FAIL, "H5Pclose");
@@ -6422,7 +6463,7 @@ test_libver_bounds_dataset(hid_t fapl)
/* 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 */
+ /* Verify the dataset's layout, fill value and filter pipeline 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
@@ -6527,7 +6568,7 @@ test_libver_bounds_dataset(hid_t fapl)
** new fapl:
** --Open the same file in (a) with the fapl
** --Create a chunked dataset, a compact dataset and
-** a contigous dataset
+** a contiguous dataset
** --Verify the dataspace message version for these
** three datasets
** --Delete the three datasets and the dataspaces
@@ -6876,7 +6917,7 @@ 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 new_fapl = H5I_INVALID_HID; /* File access 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 */
@@ -7136,7 +7177,7 @@ test_libver_bounds_attributes(hid_t fapl)
fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
- /* Integer datatpye */
+ /* Integer datatype */
tid = H5Tcopy(H5T_NATIVE_INT);
CHECK(tid, H5I_INVALID_HID, "H5Tcopy");
@@ -7245,7 +7286,7 @@ test_libver_bounds_attributes(hid_t fapl)
fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl);
CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
- /* Create an integer datatye */
+ /* Create an integer datatype */
tid = H5Tcopy(H5T_NATIVE_INT);
CHECK(tid, H5I_INVALID_HID, "H5Tcopy");
@@ -7752,7 +7793,7 @@ test_min_dset_ohdr(void)
****************************************************************/
#ifndef H5_NO_DEPRECATED_SYMBOLS
static void
-test_deprec(void)
+test_deprec(const char *env_h5_drvr)
{
hid_t file; /* File IDs for old & new files */
hid_t fcpl; /* File creation property list */
@@ -7805,166 +7846,169 @@ test_deprec(void)
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
- /* Create a file creation property list */
- fcpl = H5Pcreate(H5P_FILE_CREATE);
- CHECK(fcpl, FAIL, "H5Pcreate");
+ /* Only run this part of the test with the sec2/default driver */
+ if (h5_using_default_driver(env_h5_drvr)) {
+ /* Create a file creation property list */
+ fcpl = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(fcpl, FAIL, "H5Pcreate");
- /* Set a property in the FCPL that will push the superblock version up */
- ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, 1, (hsize_t)0);
- ret = H5Pset_file_space_page_size(fcpl, (hsize_t)512);
- CHECK(ret, FAIL, "H5Pset_file_space_strategy");
+ /* Set a property in the FCPL that will push the superblock version up */
+ ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, 1, (hsize_t)0);
+ ret = H5Pset_file_space_page_size(fcpl, (hsize_t)512);
+ CHECK(ret, FAIL, "H5Pset_file_space_strategy");
- fapl = H5Pcreate(H5P_FILE_ACCESS);
- ret = H5Pset_alignment(fapl, (hsize_t)1, (hsize_t)1024);
- CHECK(ret, FAIL, "H5Pset_alignment");
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ ret = H5Pset_alignment(fapl, (hsize_t)1, (hsize_t)1024);
+ CHECK(ret, FAIL, "H5Pset_alignment");
- /* Creating a file with the non-default file creation property list should
- * create a version 2 superblock
- */
+ /* Creating a file with the non-default file creation property list should
+ * create a version 2 superblock
+ */
- /* Create file with custom file creation property list */
- file = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl);
- CHECK(file, FAIL, "H5Fcreate");
+ /* Create file with custom file creation property list */
+ file = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl);
+ CHECK(file, FAIL, "H5Fcreate");
- new_fapl = H5Fget_access_plist(file);
- H5Pget_alignment(new_fapl, NULL, &align);
+ new_fapl = H5Fget_access_plist(file);
+ H5Pget_alignment(new_fapl, NULL, &align);
- /* Close FCPL */
- ret = H5Pclose(fcpl);
- CHECK(ret, FAIL, "H5Pclose");
+ /* Close FCPL */
+ ret = H5Pclose(fcpl);
+ CHECK(ret, FAIL, "H5Pclose");
- /* Get the file's version information */
- ret = H5Fget_info1(file, &finfo);
- CHECK(ret, FAIL, "H5Fget_info1");
- VERIFY(finfo.super_ext_size, 152, "H5Fget_info1");
- VERIFY(finfo.sohm.hdr_size, 0, "H5Fget_info1");
- VERIFY(finfo.sohm.msgs_info.index_size, 0, "H5Fget_info1");
- VERIFY(finfo.sohm.msgs_info.heap_size, 0, "H5Fget_info1");
+ /* Get the file's version information */
+ ret = H5Fget_info1(file, &finfo);
+ CHECK(ret, FAIL, "H5Fget_info1");
+ VERIFY(finfo.super_ext_size, 152, "H5Fget_info1");
+ VERIFY(finfo.sohm.hdr_size, 0, "H5Fget_info1");
+ VERIFY(finfo.sohm.msgs_info.index_size, 0, "H5Fget_info1");
+ VERIFY(finfo.sohm.msgs_info.heap_size, 0, "H5Fget_info1");
- /* Get the file's dataset creation property list */
- fcpl = H5Fget_create_plist(file);
- CHECK(fcpl, FAIL, "H5Fget_create_plist");
+ /* Get the file's dataset creation property list */
+ fcpl = H5Fget_create_plist(file);
+ CHECK(fcpl, FAIL, "H5Fget_create_plist");
- /* Get the file's version information */
- ret = H5Pget_version(fcpl, &super, &freelist, &stab, &shhdr);
- CHECK(ret, FAIL, "H5Pget_version");
- VERIFY(super, 2, "H5Pget_version");
- VERIFY(freelist, 0, "H5Pget_version");
- VERIFY(stab, 0, "H5Pget_version");
- VERIFY(shhdr, 0, "H5Pget_version");
+ /* Get the file's version information */
+ ret = H5Pget_version(fcpl, &super, &freelist, &stab, &shhdr);
+ CHECK(ret, FAIL, "H5Pget_version");
+ VERIFY(super, 2, "H5Pget_version");
+ VERIFY(freelist, 0, "H5Pget_version");
+ VERIFY(stab, 0, "H5Pget_version");
+ VERIFY(shhdr, 0, "H5Pget_version");
- /* Close FCPL */
- ret = H5Pclose(fcpl);
- CHECK(ret, FAIL, "H5Pclose");
+ /* Close FCPL */
+ ret = H5Pclose(fcpl);
+ CHECK(ret, FAIL, "H5Pclose");
- /* Close file */
- ret = H5Fclose(file);
- CHECK(ret, FAIL, "H5Fclose");
+ /* Close file */
+ ret = H5Fclose(file);
+ CHECK(ret, FAIL, "H5Fclose");
- /* Re-open the file */
- file = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
- CHECK(file, FAIL, "H5Fcreate");
+ /* Re-open the file */
+ file = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
+ CHECK(file, FAIL, "H5Fcreate");
- /* Get the file's version information */
- ret = H5Fget_info1(file, &finfo);
- CHECK(ret, FAIL, "H5Fget_info1");
- VERIFY(finfo.super_ext_size, 152, "H5Fget_info1");
- VERIFY(finfo.sohm.hdr_size, 0, "H5Fget_info1");
- VERIFY(finfo.sohm.msgs_info.index_size, 0, "H5Fget_info1");
- VERIFY(finfo.sohm.msgs_info.heap_size, 0, "H5Fget_info1");
+ /* Get the file's version information */
+ ret = H5Fget_info1(file, &finfo);
+ CHECK(ret, FAIL, "H5Fget_info1");
+ VERIFY(finfo.super_ext_size, 152, "H5Fget_info1");
+ VERIFY(finfo.sohm.hdr_size, 0, "H5Fget_info1");
+ VERIFY(finfo.sohm.msgs_info.index_size, 0, "H5Fget_info1");
+ VERIFY(finfo.sohm.msgs_info.heap_size, 0, "H5Fget_info1");
- /* Get the file's creation property list */
- fcpl = H5Fget_create_plist(file);
- CHECK(fcpl, FAIL, "H5Fget_create_plist");
+ /* Get the file's creation property list */
+ fcpl = H5Fget_create_plist(file);
+ CHECK(fcpl, FAIL, "H5Fget_create_plist");
- /* Get the file's version information */
- ret = H5Pget_version(fcpl, &super, &freelist, &stab, &shhdr);
- CHECK(ret, FAIL, "H5Pget_version");
- VERIFY(super, 2, "H5Pget_version");
- VERIFY(freelist, 0, "H5Pget_version");
- VERIFY(stab, 0, "H5Pget_version");
- VERIFY(shhdr, 0, "H5Pget_version");
+ /* Get the file's version information */
+ ret = H5Pget_version(fcpl, &super, &freelist, &stab, &shhdr);
+ CHECK(ret, FAIL, "H5Pget_version");
+ VERIFY(super, 2, "H5Pget_version");
+ VERIFY(freelist, 0, "H5Pget_version");
+ VERIFY(stab, 0, "H5Pget_version");
+ VERIFY(shhdr, 0, "H5Pget_version");
- /* Close FCPL */
- ret = H5Pclose(fcpl);
- CHECK(ret, FAIL, "H5Pclose");
+ /* Close FCPL */
+ ret = H5Pclose(fcpl);
+ CHECK(ret, FAIL, "H5Pclose");
- /* Close file */
- ret = H5Fclose(file);
- CHECK(ret, FAIL, "H5Fclose");
+ /* Close file */
+ ret = H5Fclose(file);
+ CHECK(ret, FAIL, "H5Fclose");
- { /* Test deprecated H5Pget/set_file_space() */
+ { /* Test deprecated H5Pget/set_file_space() */
- H5F_file_space_type_t old_strategy;
- hsize_t old_threshold;
- hid_t fid;
- hid_t ffcpl;
+ H5F_file_space_type_t old_strategy;
+ hsize_t old_threshold;
+ hid_t fid;
+ hid_t ffcpl;
- fcpl = H5Pcreate(H5P_FILE_CREATE);
- CHECK(fcpl, FAIL, "H5Pcreate");
+ fcpl = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(fcpl, FAIL, "H5Pcreate");
- ret = H5Pget_file_space(fcpl, &old_strategy, &old_threshold);
- CHECK(ret, FAIL, "H5Pget_file_space");
- VERIFY(old_strategy, H5F_FILE_SPACE_ALL, "H5Pget_file_space");
- VERIFY(old_threshold, H5F_FREE_SPACE_THRESHOLD_DEF, "H5Pget_file_space");
+ ret = H5Pget_file_space(fcpl, &old_strategy, &old_threshold);
+ CHECK(ret, FAIL, "H5Pget_file_space");
+ VERIFY(old_strategy, H5F_FILE_SPACE_ALL, "H5Pget_file_space");
+ VERIFY(old_threshold, H5F_FREE_SPACE_THRESHOLD_DEF, "H5Pget_file_space");
- /* Set file space strategy and free space section threshold */
- ret = H5Pset_file_space(fcpl, H5F_FILE_SPACE_ALL_PERSIST, (hsize_t)0);
- CHECK(ret, FAIL, "H5Pget_file_space");
+ /* Set file space strategy and free space section threshold */
+ ret = H5Pset_file_space(fcpl, H5F_FILE_SPACE_ALL_PERSIST, (hsize_t)0);
+ CHECK(ret, FAIL, "H5Pget_file_space");
- /* Get the file space info from the creation property */
- ret = H5Pget_file_space(fcpl, &old_strategy, &old_threshold);
- CHECK(ret, FAIL, "H5Pget_file_space");
- VERIFY(old_strategy, H5F_FILE_SPACE_ALL_PERSIST, "H5Pget_file_space");
- VERIFY(old_threshold, H5F_FREE_SPACE_THRESHOLD_DEF, "H5Pget_file_space");
+ /* Get the file space info from the creation property */
+ ret = H5Pget_file_space(fcpl, &old_strategy, &old_threshold);
+ CHECK(ret, FAIL, "H5Pget_file_space");
+ VERIFY(old_strategy, H5F_FILE_SPACE_ALL_PERSIST, "H5Pget_file_space");
+ VERIFY(old_threshold, H5F_FREE_SPACE_THRESHOLD_DEF, "H5Pget_file_space");
- ret = H5Pset_file_space(fcpl, H5F_FILE_SPACE_DEFAULT, (hsize_t)3);
- CHECK(ret, FAIL, "H5Pget_file_space");
+ ret = H5Pset_file_space(fcpl, H5F_FILE_SPACE_DEFAULT, (hsize_t)3);
+ CHECK(ret, FAIL, "H5Pget_file_space");
- ret = H5Pget_file_space(fcpl, &old_strategy, &old_threshold);
- CHECK(ret, FAIL, "H5Pget_file_space");
- VERIFY(old_strategy, H5F_FILE_SPACE_ALL_PERSIST, "H5Pget_file_space");
- VERIFY(old_threshold, 3, "H5Pget_file_space");
+ ret = H5Pget_file_space(fcpl, &old_strategy, &old_threshold);
+ CHECK(ret, FAIL, "H5Pget_file_space");
+ VERIFY(old_strategy, H5F_FILE_SPACE_ALL_PERSIST, "H5Pget_file_space");
+ VERIFY(old_threshold, 3, "H5Pget_file_space");
- /* Create a file */
- fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT);
- CHECK(file, FAIL, "H5Fcreate");
+ /* Create a file */
+ fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT);
+ CHECK(file, FAIL, "H5Fcreate");
- old_strategy = H5F_FILE_SPACE_DEFAULT;
- old_threshold = 0;
- ffcpl = H5Fget_create_plist(fid);
- ret = H5Pget_file_space(ffcpl, &old_strategy, &old_threshold);
- CHECK(ret, FAIL, "H5Pget_file_space");
- VERIFY(old_strategy, H5F_FILE_SPACE_ALL_PERSIST, "H5Pget_file_space");
- VERIFY(old_threshold, 3, "H5Pget_file_space");
+ old_strategy = H5F_FILE_SPACE_DEFAULT;
+ old_threshold = 0;
+ ffcpl = H5Fget_create_plist(fid);
+ ret = H5Pget_file_space(ffcpl, &old_strategy, &old_threshold);
+ CHECK(ret, FAIL, "H5Pget_file_space");
+ VERIFY(old_strategy, H5F_FILE_SPACE_ALL_PERSIST, "H5Pget_file_space");
+ VERIFY(old_threshold, 3, "H5Pget_file_space");
- /* Close file */
- ret = H5Fclose(fid);
- CHECK(ret, FAIL, "H5Fclose");
+ /* Close file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
- ret = H5Pclose(ffcpl);
- CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Pclose(ffcpl);
+ CHECK(ret, FAIL, "H5Pclose");
- ret = H5Pclose(fcpl);
- CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Pclose(fcpl);
+ CHECK(ret, FAIL, "H5Pclose");
- /* Reopen the file */
- fid = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
- CHECK(fid, FAIL, "H5Fcreate");
+ /* Reopen the file */
+ fid = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fcreate");
- old_strategy = H5F_FILE_SPACE_DEFAULT;
- old_threshold = 0;
- ffcpl = H5Fget_create_plist(fid);
- ret = H5Pget_file_space(ffcpl, &old_strategy, &old_threshold);
- CHECK(ret, FAIL, "H5Pget_file_space");
- VERIFY(old_strategy, H5F_FILE_SPACE_ALL_PERSIST, "H5Pget_file_space");
- VERIFY(old_threshold, 3, "H5Pget_file_space");
+ old_strategy = H5F_FILE_SPACE_DEFAULT;
+ old_threshold = 0;
+ ffcpl = H5Fget_create_plist(fid);
+ ret = H5Pget_file_space(ffcpl, &old_strategy, &old_threshold);
+ CHECK(ret, FAIL, "H5Pget_file_space");
+ VERIFY(old_strategy, H5F_FILE_SPACE_ALL_PERSIST, "H5Pget_file_space");
+ VERIFY(old_threshold, 3, "H5Pget_file_space");
- ret = H5Pclose(ffcpl);
- CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Pclose(ffcpl);
+ CHECK(ret, FAIL, "H5Pclose");
- ret = H5Fclose(fid);
- CHECK(ret, FAIL, "H5Fclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ }
}
} /* test_deprec */
@@ -7978,15 +8022,16 @@ test_deprec(void)
void
test_file(void)
{
- const char *env_h5_drvr; /* File Driver value from environment */
- hid_t fapl_id = H5I_INVALID_HID; /* VFD-dependent fapl ID */
+ const char *env_h5_drvr; /* File Driver value from environment */
+ hid_t fapl_id = H5I_INVALID_HID; /* VFD-dependent fapl ID */
+ hbool_t driver_uses_modified_filename = h5_driver_uses_modified_filename();
herr_t ret;
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File I/O\n"));
/* Get the VFD to use */
- env_h5_drvr = HDgetenv("HDF5_DRIVER");
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
if (env_h5_drvr == NULL)
env_h5_drvr = "nomatch";
@@ -7995,7 +8040,7 @@ test_file(void)
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_open(env_h5_drvr); /* Test file opening */
test_file_reopen(); /* Test file reopening */
test_file_close(); /* Test file close behavior */
test_get_file_id(); /* Test H5Iget_file_id */
@@ -8013,14 +8058,19 @@ test_file(void)
test_file_double_datatype_open(); /* Test opening same named datatype from two files works properly */
test_file_double_file_dataset_open(TRUE);
test_file_double_file_dataset_open(FALSE);
- test_userblock_file_size(); /* Tests that files created with a userblock have the correct size */
- test_cached_stab_info(); /* Tests that files are created with cached stab info in the superblock */
- test_rw_noupdate(); /* Test to ensure that RW permissions don't write the file unless dirtied */
- test_userblock_alignment(); /* Tests that files created with a userblock and alignment interact properly
- */
- test_userblock_alignment_paged(); /* Tests files created with a userblock and alignment (via paged
- aggregation) interact properly */
- test_filespace_info(env_h5_drvr); /* Test file creation public routines: */
+ test_userblock_file_size(
+ env_h5_drvr); /* Tests that files created with a userblock have the correct size */
+ test_cached_stab_info(); /* Tests that files are created with cached stab info in the superblock */
+
+ if (!driver_uses_modified_filename) {
+ test_rw_noupdate(); /* Test to ensure that RW permissions don't write the file unless dirtied */
+ }
+
+ test_userblock_alignment(
+ env_h5_drvr); /* Tests that files created with a userblock and alignment interact properly */
+ test_userblock_alignment_paged(env_h5_drvr); /* Tests files created with a userblock and alignment (via
+ paged aggregation) interact properly */
+ test_filespace_info(env_h5_drvr); /* Test file creation public routines: */
/* H5Pget/set_file_space_strategy() & H5Pget/set_file_space_page_size() */
/* Skipped testing for multi/split drivers */
test_file_freespace(env_h5_drvr); /* Test file public routine H5Fget_freespace() */
@@ -8032,19 +8082,25 @@ test_file(void)
/* Setup for multi/split drivers are there already */
test_sects_freespace(env_h5_drvr, FALSE); /* Test file public routine H5Fget_free_sections() */
/* Skipped testing for multi/split drivers */
- test_filespace_compatible(); /* Test compatibility for file space management */
- 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();
+
+ if (!driver_uses_modified_filename) {
+ test_filespace_compatible(); /* Test compatibility for file space management */
+
+ 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(env_h5_drvr);
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 */
+ test_min_dset_ohdr(); /* Test dataset object header minimization */
#ifndef H5_NO_DEPRECATED_SYMBOLS
test_file_ishdf5(env_h5_drvr); /* Test detecting HDF5 files correctly */
- test_deprec(); /* Test deprecated routines */
+ test_deprec(env_h5_drvr); /* Test deprecated routines */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
ret = H5Pclose(fapl_id);
@@ -8069,13 +8125,17 @@ test_file(void)
void
cleanup_file(void)
{
- HDremove(SFILE1);
- HDremove(FILE1);
- HDremove(FILE2);
- HDremove(FILE3);
- HDremove(FILE4);
- HDremove(FILE5);
- HDremove(FILE6);
- HDremove(FILE7);
- HDremove(DST_FILE);
+ H5E_BEGIN_TRY
+ {
+ H5Fdelete(SFILE1, H5P_DEFAULT);
+ H5Fdelete(FILE1, H5P_DEFAULT);
+ H5Fdelete(FILE2, H5P_DEFAULT);
+ H5Fdelete(FILE3, H5P_DEFAULT);
+ H5Fdelete(FILE4, H5P_DEFAULT);
+ H5Fdelete(FILE5, H5P_DEFAULT);
+ H5Fdelete(FILE6, H5P_DEFAULT);
+ H5Fdelete(FILE7, H5P_DEFAULT);
+ H5Fdelete(DST_FILE, H5P_DEFAULT);
+ }
+ H5E_END_TRY;
}
diff --git a/test/tgenprop.c b/test/tgenprop.c
index 55e5a9b..f54fbbc 100644
--- a/test/tgenprop.c
+++ b/test/tgenprop.c
@@ -107,7 +107,7 @@ test_genprop_basic_class(void)
ret = H5Pequal(cid2, H5P_ROOT);
VERIFY(ret, 1, "H5Pequal");
- /* Make certain false postives aren't being returned */
+ /* Make certain false positives aren't being returned */
ret = H5Pequal(cid2, H5P_FILE_CREATE);
VERIFY(ret, 0, "H5Pequal");
@@ -185,7 +185,7 @@ test_genprop_basic_class_prop(void)
CHECK_I(ret, "H5Pget_nprops");
VERIFY(nprops, 0, "H5Pget_nprops");
- /* Check the existance of the first property (should fail) */
+ /* Check the existence of the first property (should fail) */
ret = H5Pexist(cid1, PROP1_NAME);
VERIFY(ret, 0, "H5Pexist");
@@ -199,7 +199,7 @@ test_genprop_basic_class_prop(void)
H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
VERIFY(ret, FAIL, "H5Pregister2");
- /* Check the existance of the first property */
+ /* Check the existence of the first property */
ret = H5Pexist(cid1, PROP1_NAME);
VERIFY(ret, 1, "H5Pexist");
@@ -223,7 +223,7 @@ test_genprop_basic_class_prop(void)
H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
VERIFY(ret, FAIL, "H5Pregister2");
- /* Check the existance of the second property */
+ /* Check the existence of the second property */
ret = H5Pexist(cid1, PROP2_NAME);
VERIFY(ret, 1, "H5Pexist");
@@ -242,7 +242,7 @@ test_genprop_basic_class_prop(void)
H5Pregister2(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
- /* Check the existance of the third property */
+ /* Check the existence of the third property */
ret = H5Pexist(cid1, PROP3_NAME);
VERIFY(ret, 1, "H5Pexist");
@@ -1942,7 +1942,7 @@ test_genprop_deprec_class(void)
CHECK_I(ret, "H5Pget_nprops");
VERIFY(nprops, 0, "H5Pget_nprops");
- /* Check the existance of the first property (should fail) */
+ /* Check the existence of the first property (should fail) */
ret = H5Pexist(cid1, PROP1_NAME);
VERIFY(ret, 0, "H5Pexist");
@@ -1954,7 +1954,7 @@ test_genprop_deprec_class(void)
ret = H5Pregister1(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL);
VERIFY(ret, FAIL, "H5Pregister1");
- /* Check the existance of the first property */
+ /* Check the existence of the first property */
ret = H5Pexist(cid1, PROP1_NAME);
VERIFY(ret, 1, "H5Pexist");
@@ -1976,7 +1976,7 @@ test_genprop_deprec_class(void)
ret = H5Pregister1(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL);
VERIFY(ret, FAIL, "H5Pregister1");
- /* Check the existance of the second property */
+ /* Check the existence of the second property */
ret = H5Pexist(cid1, PROP2_NAME);
VERIFY(ret, 1, "H5Pexist");
@@ -1994,7 +1994,7 @@ test_genprop_deprec_class(void)
ret = H5Pregister1(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister1");
- /* Check the existance of the third property */
+ /* Check the existence of the third property */
ret = H5Pexist(cid1, PROP3_NAME);
VERIFY(ret, 1, "H5Pexist");
diff --git a/test/th5o.c b/test/th5o.c
index ebb6c6e..9504f7a 100644
--- a/test/th5o.c
+++ b/test/th5o.c
@@ -43,14 +43,17 @@ test_h5o_open(void)
{
hid_t fid; /* HDF5 File ID */
hid_t grp, dset, dtype, dspace; /* Object identifiers */
+ char filename[1024];
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 */
+ h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename);
+
/* Create a new HDF5 file */
- fid = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fcreate");
/* Create a group, dataset, and committed datatype within the file */
@@ -155,11 +158,14 @@ test_h5o_close(void)
{
hid_t fid; /* HDF5 File ID */
hid_t grp, dset, dtype, dspace; /* Object identifiers */
+ char filename[1024];
hsize_t dims[RANK];
herr_t ret; /* Value returned from API calls */
+ h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename);
+
/* Create a new HDF5 file */
- fid = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fcreate");
/* Create a group, dataset, and committed datatype within the file */
@@ -247,8 +253,9 @@ test_h5o_open_by_addr(void)
{
hid_t fid; /* HDF5 File ID */
hid_t grp, dset, dtype, dspace; /* Object identifiers */
- H5L_info2_t li; /* Buffer for H5Lget_info2 */
- haddr_t grp_addr; /* Addresses for objects */
+ char filename[1024];
+ H5L_info2_t li; /* Buffer for H5Lget_info2 */
+ haddr_t grp_addr; /* Addresses for objects */
haddr_t dset_addr;
haddr_t dtype_addr;
hsize_t dims[RANK];
@@ -257,8 +264,10 @@ test_h5o_open_by_addr(void)
H5T_class_t type_class; /* Class of the datatype */
herr_t ret; /* Value returned from API calls */
+ h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename);
+
/* Create a new HDF5 file */
- fid = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fcreate");
/* Create a group, dataset, and committed datatype within the file */
@@ -397,15 +406,18 @@ 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 */
+ char filename[1024];
+ 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 */
+ h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename);
+
/* Create a new HDF5 file */
- fid = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fcreate");
/* Create a group, dataset, and committed datatype within the file */
@@ -515,12 +527,15 @@ test_h5o_refcount(void)
{
hid_t fid; /* HDF5 File ID */
hid_t grp, dset, dtype, dspace; /* Object identifiers */
- H5O_info2_t oinfo; /* Object info struct */
+ char filename[1024];
+ H5O_info2_t oinfo; /* Object info struct */
hsize_t dims[RANK];
herr_t ret; /* Value returned from API calls */
+ h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename);
+
/* Create a new HDF5 file */
- fid = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fcreate");
/* Create a group, dataset, and committed datatype within the file */
@@ -594,7 +609,7 @@ test_h5o_refcount(void)
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 */
+ /* Increment the reference counts and then close the file to make sure the increment is permanent */
ret = H5Oincr_refcount(grp);
CHECK(ret, FAIL, "H5Oincr_refcount");
ret = H5Oincr_refcount(dtype);
@@ -612,7 +627,7 @@ test_h5o_refcount(void)
CHECK(ret, FAIL, "H5Fclose");
/* Re-open the file and check that the reference counts were really incremented */
- fid = H5Fopen(TEST_FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
+ fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
grp = H5Gopen2(fid, "group", H5P_DEFAULT);
@@ -650,7 +665,7 @@ test_h5o_refcount(void)
CHECK(ret, FAIL, "H5Fclose");
/* Re-open the file and check that the reference counts were really decremented */
- fid = H5Fopen(TEST_FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
+ fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
grp = H5Gopen2(fid, "group", H5P_DEFAULT);
@@ -709,10 +724,11 @@ test_h5o_refcount(void)
static void
test_h5o_plist(void)
{
- hid_t fid; /* HDF5 File ID */
- hid_t grp, dset, dtype, dspace; /* Object identifiers */
- hid_t fapl; /* File access property list */
- hid_t gcpl, dcpl, tcpl; /* Object creation properties */
+ hid_t fid; /* HDF5 File ID */
+ hid_t grp, dset, dtype, dspace; /* Object identifiers */
+ hid_t fapl; /* File access property list */
+ hid_t gcpl, dcpl, tcpl; /* Object creation properties */
+ char filename[1024];
unsigned def_max_compact, def_min_dense; /* Default phase change parameters */
unsigned max_compact, min_dense; /* Actual phase change parameters */
herr_t ret; /* Value returned from API calls */
@@ -725,8 +741,10 @@ test_h5o_plist(void)
ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
CHECK(ret, FAIL, "H5Pset_libver_bounds");
+ h5_fixname(TEST_FILENAME, fapl, filename, sizeof filename);
+
/* Create a new HDF5 file */
- fid = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
CHECK(fid, FAIL, "H5Fcreate");
/* Create group, dataset & named datatype creation property lists */
@@ -840,7 +858,7 @@ test_h5o_plist(void)
CHECK(ret, FAIL, "H5Fclose");
/* Re-open the file and check that the object creation properties persist */
- fid = H5Fopen(TEST_FILENAME, H5F_ACC_RDONLY, fapl);
+ fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl);
CHECK(fid, FAIL, "H5Fopen");
/* Re-open objects */
@@ -909,7 +927,8 @@ test_h5o_link(void)
hid_t type_id = -1;
hid_t fapl_id = -1;
hid_t lcpl_id = -1;
- hsize_t dims[2] = {TEST6_DIM1, TEST6_DIM2};
+ char filename[1024];
+ hsize_t dims[2] = {TEST6_DIM1, TEST6_DIM2};
htri_t committed; /* Whether the named datatype is committed */
H5F_libver_t low, high; /* File format bounds */
int * wdata;
@@ -917,6 +936,8 @@ test_h5o_link(void)
int i, n;
herr_t ret; /* Value returned from API calls */
+ h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename);
+
/* Allocate memory buffers */
/* (These are treated as 2-D buffers) */
wdata = (int *)HDmalloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int));
@@ -957,7 +978,7 @@ test_h5o_link(void)
continue;
/* Create a new HDF5 file */
- file_id = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
CHECK(file_id, FAIL, "H5Fcreate");
/* Close the FAPL */
@@ -1060,6 +1081,7 @@ test_h5o_comment(void)
hid_t fid; /* HDF5 File ID */
hid_t grp, dset, dtype, dspace; /* Object identifiers */
hid_t attr_space, attr_id;
+ char filename[1024];
hsize_t dims[RANK];
hsize_t attr_dims = 1;
int attr_value = 5;
@@ -1073,8 +1095,10 @@ test_h5o_comment(void)
herr_t ret; /* Value returned from API calls */
int ret_value;
+ h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename);
+
/* Create a new HDF5 file */
- fid = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fcreate");
/* Create an attribute for the file */
@@ -1152,7 +1176,7 @@ test_h5o_comment(void)
/* Now make sure that the comments are correct all 4 types of objects */
/* Open file */
- fid = H5Fopen(TEST_FILENAME, H5F_ACC_RDONLY, H5P_DEFAULT);
+ fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
/* Getting the comment on the file and verify it */
@@ -1232,6 +1256,7 @@ test_h5o_comment_by_name(void)
hid_t fid; /* HDF5 File ID */
hid_t grp, dset, dtype, dspace; /* Object identifiers */
hid_t attr_space, attr_id;
+ char filename[1024];
hsize_t dims[RANK];
hsize_t attr_dims = 1;
int attr_value = 5;
@@ -1245,8 +1270,10 @@ test_h5o_comment_by_name(void)
herr_t ret; /* Value returned from API calls */
int ret_value;
+ h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename);
+
/* Create a new HDF5 file */
- fid = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fcreate");
/* Create an attribute for the file */
@@ -1324,7 +1351,7 @@ test_h5o_comment_by_name(void)
/* Now make sure that the comments are correct all 4 types of objects */
/* Open file */
- fid = H5Fopen(TEST_FILENAME, H5F_ACC_RDONLY, H5P_DEFAULT);
+ fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
/* Getting the comment on the file and verify it */
@@ -1390,13 +1417,16 @@ test_h5o_comment_by_name(void)
static void
test_h5o_getinfo_same_file(void)
{
- hid_t fid1, fid2; /* HDF5 File ID */
- hid_t gid1, gid2; /* Group IDs */
+ hid_t fid1, fid2; /* HDF5 File ID */
+ hid_t gid1, gid2; /* Group IDs */
+ char filename[1024];
H5O_info2_t oinfo1, oinfo2; /* Object info structs */
herr_t ret; /* Value returned from API calls */
+ h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename);
+
/* Create a new HDF5 file */
- fid1 = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid1, FAIL, "H5Fcreate");
/* Create two groups in the file */
@@ -1438,9 +1468,9 @@ test_h5o_getinfo_same_file(void)
CHECK(ret, FAIL, "H5Fclose");
/* Open file twice */
- fid1 = H5Fopen(TEST_FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
+ fid1 = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT);
CHECK(fid1, FAIL, "H5Fopen");
- fid2 = H5Fopen(TEST_FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
+ fid2 = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT);
CHECK(fid2, FAIL, "H5Fopen");
/* Open the two groups in the file */
@@ -1497,8 +1527,9 @@ 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 */
+ char filename[1024];
+ 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];
@@ -1507,8 +1538,10 @@ test_h5o_open_by_addr_deprec(void)
H5T_class_t type_class; /* Class of the datatype */
herr_t ret; /* Value returned from API calls */
+ h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename);
+
/* Create a new HDF5 file */
- fid = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fcreate");
/* Create a group, dataset, and committed datatype within the file */
@@ -1682,13 +1715,16 @@ test_h5o_getinfo_visit(void)
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 */
+ char filename[1024];
+ 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 */
+
+ h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename);
/* Create an HDF5 file */
- fid = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fcreate");
/* Create "group1" in the file */
@@ -1806,5 +1842,12 @@ test_h5o(void)
void
cleanup_h5o(void)
{
- HDremove(TEST_FILENAME);
+ char filename[1024];
+
+ H5E_BEGIN_TRY
+ {
+ h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename);
+ H5Fdelete(filename, H5P_DEFAULT);
+ }
+ H5E_END_TRY;
}
diff --git a/test/th5s.c b/test/th5s.c
index 51216dc..1bc19d4 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -194,7 +194,7 @@ test_h5s_basic(void)
* If this test fails and the H5S_MAX_RANK variable has changed, follow
* the instructions in space_overflow.c for regenerating the th5s.h5 file.
*/
- {
+ if (!h5_driver_uses_modified_filename()) {
const char *testfile = H5_get_srcdir_filename(TESTFILE); /* Corrected test file name */
fid1 = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
@@ -2022,7 +2022,7 @@ 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 */
+ 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 */
diff --git a/test/tid.c b/test/tid.c
index 0a45116..583004e 100644
--- a/test/tid.c
+++ b/test/tid.c
@@ -41,7 +41,7 @@ basic_id_test(void)
int num_ref;
hsize_t num_members;
- /* Try to register an ID with ficticious types */
+ /* Try to register an ID with fictitious types */
H5E_BEGIN_TRY
arrayID = H5Iregister((H5I_type_t)420, testObj);
H5E_END_TRY
@@ -58,7 +58,7 @@ basic_id_test(void)
if (arrayID != H5I_INVALID_HID)
goto out;
- /* Try to access IDs with ficticious types */
+ /* Try to access IDs with fictitious types */
H5E_BEGIN_TRY
testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t)0);
H5E_END_TRY
diff --git a/test/titerate.c b/test/titerate.c
index 10ed039..1d87343 100644
--- a/test/titerate.c
+++ b/test/titerate.c
@@ -1175,8 +1175,10 @@ test_iterate(void)
#endif
} /* end for */
- /* Test the fix for issue HDFFV-10588 */
- test_corrupted_attnamelen();
+ if (!h5_driver_uses_modified_filename()) {
+ /* Test the fix for issue HDFFV-10588 */
+ test_corrupted_attnamelen();
+ }
/* Close FAPLs */
ret = H5Pclose(fapl);
diff --git a/test/tmisc.c b/test/tmisc.c
index b267330..f8bf602 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -287,7 +287,7 @@ typedef struct {
#define MISC25C_ATTRNAME2 "ab"
/* Definitions for misc. test #26 */
-#define MISC26_FILE "dcpl_file"
+#define MISC26_FILE "dcpl_file.h5"
/* Definitions for misc. test #27 */
/* (Note that this test file is generated by the "gen_bad_ohdr.c" code) */
@@ -1083,7 +1083,7 @@ test_misc6(void)
/* Loop through adding attributes to each dataset */
for (u = 0; u < MISC6_NUMATTR; u++) {
/* Create name for attribute */
- HDsprintf(attr_name, "Attr#%u", u);
+ HDsnprintf(attr_name, sizeof(attr_name), "Attr#%u", u);
/* Open the file */
loc_id = H5Fopen(MISC6_FILE, H5F_ACC_RDWR, H5P_DEFAULT);
@@ -1280,7 +1280,7 @@ test_misc8(void)
for (v = 0; v < MISC8_DIM1; v++)
*tdata++ = (int)(((u * MISC8_DIM1) + v) % 13);
- /* Create a file acccess property list */
+ /* Create a file access property list */
fapl = H5Pcreate(H5P_FILE_ACCESS);
CHECK(fapl, FAIL, "H5Pcreate");
@@ -3034,7 +3034,7 @@ test_misc18(void)
/* Loop creating attributes on each dataset, flushing them to the file each time */
for (u = 0; u < 10; u++) {
/* Set up attribute name */
- HDsprintf(attr_name, "Attr %u", u);
+ HDsnprintf(attr_name, sizeof(attr_name), "Attr %u", u);
/* Create & close attribute on first dataset */
aid = H5Acreate2(did1, attr_name, H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT);
@@ -3892,7 +3892,7 @@ test_misc21(void)
/****************************************************************
**
-** test_misc22(): Test SZIP bits-per-pixel paramter.
+** test_misc22(): Test SZIP bits-per-pixel parameter.
** This should be set according to the datatype.
** Tests for precision and offset combo's.
**
@@ -5504,7 +5504,7 @@ test_misc30(void)
CHECK(ret, FAIL, "test_misc30_get_info");
}
- HDsprintf(gname, "/g0/group%d", i);
+ HDsnprintf(gname, sizeof(gname), "/g0/group%d", i);
gid = H5Gcreate2(fid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(gid, FAIL, "H5Gcreate2");
@@ -6026,29 +6026,51 @@ test_misc36(void)
void
test_misc(void)
{
+ hbool_t driver_uses_modified_filename = h5_driver_uses_modified_filename();
+ hbool_t default_driver = h5_using_default_driver(NULL);
+
/* Output message about test being performed */
MESSAGE(5, ("Testing Miscellaneous Routines\n"));
- test_misc1(); /* Test unlinking a dataset & immediately re-using name */
- test_misc2(); /* Test storing a VL-derived datatype in two different files */
- test_misc3(); /* Test reading from chunked dataset with non-zero fill value */
- test_misc4(); /* Test retrieving the fileno for various objects with H5Oget_info() */
- test_misc5(); /* Test several level deep nested compound & VL datatypes */
- test_misc6(); /* Test object header continuation code */
- test_misc7(); /* Test for sensible datatypes stored on disk */
- test_misc8(); /* Test storage sizes of various types of dataset storage */
- test_misc9(); /* Test for opening (not creating) core files */
- test_misc10(); /* Test for using dataset creation property lists from old files */
- test_misc11(); /* Test for all properties of a file creation property list being stored */
+ test_misc1(); /* Test unlinking a dataset & immediately re-using name */
+ test_misc2(); /* Test storing a VL-derived datatype in two different files */
+ test_misc3(); /* Test reading from chunked dataset with non-zero fill value */
+ test_misc4(); /* Test retrieving the fileno for various objects with H5Oget_info() */
+ test_misc5(); /* Test several level deep nested compound & VL datatypes */
+ test_misc6(); /* Test object header continuation code */
+ test_misc7(); /* Test for sensible datatypes stored on disk */
+ test_misc8(); /* Test storage sizes of various types of dataset storage */
+ test_misc9(); /* Test for opening (not creating) core files */
+
+ if (!driver_uses_modified_filename) {
+ test_misc10(); /* Test for using dataset creation property lists from old files */
+ }
+
+ if (default_driver) {
+ test_misc11(); /* Test for all properties of a file creation property list being stored */
+ }
+
test_misc12(); /* Test VL-strings in chunked datasets operating correctly */
- test_misc13(); /* Test that a user block can be insert in front of file contents */
+
+ if (default_driver) {
+ test_misc13(); /* Test that a user block can be insert in front of file contents */
+ }
+
test_misc14(); /* Test that deleted dataset's data is removed from sieve buffer correctly */
- test_misc15(); /* Test that checking a file's access property list more than once works */
+
+ if (!driver_uses_modified_filename) {
+ test_misc15(); /* Test that checking a file's access property list more than once works */
+ }
+
test_misc16(); /* Test array of fixed-length string */
test_misc17(); /* Test array of ASCII character */
test_misc18(); /* Test new object header information in H5O_info_t struct */
test_misc19(); /* Test incrementing & decrementing ref count on IDs */
- test_misc20(); /* Test problems with truncated dimensions in version 2 of storage layout message */
+
+ if (!driver_uses_modified_filename) {
+ test_misc20(); /* Test problems with truncated dimensions in version 2 of storage layout message */
+ }
+
#ifdef H5_HAVE_FILTER_SZIP
test_misc21(); /* Test that "late" allocation time is treated the same as "incremental", for chunked
datasets w/a filters */
@@ -6057,19 +6079,39 @@ test_misc(void)
test_misc23(); /* Test intermediate group creation */
test_misc24(); /* Test inappropriate API opens of objects */
test_misc25a(); /* Exercise null object header message merge bug */
- test_misc25b(); /* Exercise null object header message merge bug on existing file */
+
+ if (!driver_uses_modified_filename) {
+ test_misc25b(); /* Exercise null object header message merge bug on existing file */
+ }
+
test_misc25c(); /* Exercise another null object header message merge bug */
test_misc26(); /* Test closing property lists with long filter pipelines */
- test_misc27(); /* Test opening file with object that has bad # of object header messages */
- test_misc28(); /* Test that chunks are cached appropriately */
- test_misc29(); /* Test that speculative metadata reads are handled correctly */
- test_misc30(); /* Exercise local heap loading bug where free lists were getting dropped */
- 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_misc36(); /* Exercise H5atclose and H5is_library_terminating */
+
+ if (!driver_uses_modified_filename) {
+ test_misc27(); /* Test opening file with object that has bad # of object header messages */
+ }
+
+ test_misc28(); /* Test that chunks are cached appropriately */
+
+ if (!driver_uses_modified_filename) {
+ test_misc29(); /* Test that speculative metadata reads are handled correctly */
+ }
+
+ test_misc30(); /* Exercise local heap loading bug where free lists were getting dropped */
+
+ if (default_driver) {
+ test_misc31(); /* Test Reentering library through deprecated routines after H5close() */
+ }
+
+ test_misc32(); /* Test filter memory allocation functions */
+
+ if (!driver_uses_modified_filename) {
+ 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_misc36(); /* Exercise H5atclose and H5is_library_terminating */
} /* test_misc() */
diff --git a/test/trefer.c b/test/trefer.c
index 9b6c415..95e601e 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -2732,7 +2732,7 @@ test_reference_compat_conv(void)
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 */
+ dims3[] = {SPACE1_DIM1}; /* Purposely 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 */
@@ -3452,11 +3452,17 @@ test_reference_perf(void)
void
test_reference(void)
{
- H5F_libver_t low, high; /* Low and high bounds */
+ H5F_libver_t low, high; /* Low and high bounds */
+ const char * env_h5_drvr; /* File Driver value from environment */
/* Output message about test being performed */
MESSAGE(5, ("Testing References\n"));
+ /* Get the VFD to use */
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
+ if (env_h5_drvr == NULL)
+ env_h5_drvr = "nomatch";
+
test_reference_params(); /* Test for correct parameter checking */
test_reference_obj(); /* Test basic H5R object reference code */
test_reference_vlen_obj(); /* Test reference within vlen */
@@ -3476,7 +3482,11 @@ test_reference(void)
} /* end high bound */
} /* end low bound */
- test_reference_obj_deleted(); /* Test H5R object reference code for deleted objects */
+ /* The following test is currently broken with the Direct VFD */
+ if (HDstrcmp(env_h5_drvr, "direct") != 0) {
+ 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 */
diff --git a/test/trefstr.c b/test/trefstr.c
index d0575ab..89e62db 100644
--- a/test/trefstr.c
+++ b/test/trefstr.c
@@ -309,7 +309,7 @@ test_refstr_asprintf_cat(void)
/* Get pointer to raw string in ref-counted string */
s = H5RS_get_str(rs);
CHECK_PTR(s, "H5RS_get_str");
- HDsprintf(buf, "%d-%s", (int)10, "foo");
+ HDsnprintf(buf, sizeof(buf), "%d-%s", (int)10, "foo");
cmp = HDstrcmp(s, buf);
VERIFY(cmp, 0, "HDstrcmp");
@@ -320,7 +320,7 @@ test_refstr_asprintf_cat(void)
/* Get pointer to raw string in ref-counted string */
s = H5RS_get_str(rs);
CHECK_PTR(s, "H5RS_get_str");
- HDsprintf(buf, "%d-%s-%f", (int)10, "foo", (double)20.0);
+ HDsnprintf(buf, sizeof(buf), "%d-%s-%f", (int)10, "foo", (double)20.0);
cmp = HDstrcmp(s, buf);
VERIFY(cmp, 0, "HDstrcmp");
@@ -360,7 +360,7 @@ test_refstr_acat(void)
/* Get pointer to raw string in ref-counted string */
s = H5RS_get_str(rs);
CHECK_PTR(s, "H5RS_get_str");
- HDsprintf(buf, "%s", "foo");
+ HDsnprintf(buf, sizeof(buf), "%s", "foo");
cmp = HDstrcmp(s, buf);
VERIFY(cmp, 0, "HDstrcmp");
@@ -371,7 +371,7 @@ test_refstr_acat(void)
/* Get pointer to raw string in ref-counted string */
s = H5RS_get_str(rs);
CHECK_PTR(s, "H5RS_get_str");
- HDsprintf(buf, "%s", "foobar");
+ HDsnprintf(buf, sizeof(buf), "%s", "foobar");
cmp = HDstrcmp(s, buf);
VERIFY(cmp, 0, "HDstrcmp");
@@ -386,7 +386,7 @@ test_refstr_acat(void)
/* Get pointer to raw string in ref-counted string */
s = H5RS_get_str(rs);
CHECK_PTR(s, "H5RS_get_str");
- HDsprintf(buf, "%s", "foobar");
+ HDsnprintf(buf, sizeof(buf), "%s", "foobar");
large_str2 = HDmalloc(1024 + 6);
CHECK_PTR(large_str2, "HDmalloc");
HDstrcpy(large_str2, "foobar");
diff --git a/test/tselect.c b/test/tselect.c
index 1bfb663..0d4176b 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -1879,7 +1879,7 @@ verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf, size_t H5_ATTR
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 mismatch in expected value */
HDassert(cube_buf);
HDassert(cube_size > 0);
@@ -2357,7 +2357,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, co
/* 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
+ * into memory, and verify that it contains the expected
* data. Verify that H5Sselect_shape_same() returns true on
* the memory and file selections.
*/
@@ -2742,7 +2742,7 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, u
i++;
} while ((i <= 1) && (0 >= sel_offset));
- /* Wierdness alert:
+ /* Weirdness alert:
*
* Some how, it seems that selections can extend beyond the
* boundaries of the target dataspace -- hence the following
@@ -3401,7 +3401,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
/* 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
+ * read the on disk large cube * into memory, and verify that
* it contains the expected * data. Verify that
* H5Sselect_shape_same() returns true on the memory and file
* selections.
@@ -5256,7 +5256,7 @@ test_select_hyper_union_stagger(void)
error = H5Fclose(file_id);
CHECK(error, FAIL, "H5Fclose");
- /* Initialize intput buffer */
+ /* Initialize input buffer */
HDmemset(data_out, 0, 7 * 7 * sizeof(int));
/* Open file */
@@ -10862,13 +10862,15 @@ test_shape_same_dr__full_space_vs_slice(int test_num, int small_rank, int large_
HDassert(edge_size > 0);
HDassert(edge_size <= 1000);
- HDsprintf(test_desc_0, "\tn-cube slice through m-cube (n <= m) test %d.\n", test_num);
+ HDsnprintf(test_desc_0, sizeof(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 */
- 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], (int)dim_selected[1], (int)dim_selected[2],
- (int)dim_selected[3], (int)dim_selected[4]);
+ HDsnprintf(test_desc_1, sizeof(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], (int)dim_selected[1], (int)dim_selected[2], (int)dim_selected[3],
+ (int)dim_selected[4]);
MESSAGE(7, (test_desc_1));
/* copy the edge size into the dims array */
@@ -11120,15 +11122,16 @@ test_shape_same_dr__checkerboard(int test_num, int small_rank, int large_rank, i
HDassert(dims_selected >= 0);
HDassert(dims_selected <= large_rank);
- HDsprintf(test_desc_0, "\tcheckerboard n-cube slice through m-cube (n <= m) test %d.\n", test_num);
+ HDsnprintf(test_desc_0, sizeof(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 */
- 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, offset, (int)dim_selected[0],
- (int)dim_selected[1], (int)dim_selected[2], (int)dim_selected[3], (int)dim_selected[4],
- dims_selected);
+ HDsnprintf(test_desc_1, sizeof(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, offset, (int)dim_selected[0],
+ (int)dim_selected[1], (int)dim_selected[2], (int)dim_selected[3], (int)dim_selected[4],
+ dims_selected);
MESSAGE(7, (test_desc_1));
/* copy the edge size into the dims array */
@@ -11251,7 +11254,7 @@ test_shape_same_dr__checkerboard(int test_num, int small_rank, int large_rank, i
CHECK(ret, FAIL, "H5Sselect_hyperslab");
} /* end if */
- /* Wierdness alert:
+ /* Weirdness alert:
*
* Some how, it seems that selections can extend beyond the
* boundaries of the target dataspace -- hence the following
@@ -11346,7 +11349,7 @@ test_shape_same_dr__checkerboard(int test_num, int small_rank, int large_rank, i
CHECK(ret, FAIL, "H5Sselect_hyperslab");
} /* end if */
- /* Wierdness alert:
+ /* Weirdness alert:
*
* Again, it seems that selections can extend beyond the
* boundaries of the target dataspace -- hence the following
@@ -11664,15 +11667,16 @@ test_shape_same_dr__irregular(int test_num, int small_rank, int large_rank, int
HDassert(dims_selected >= 0);
HDassert(dims_selected <= large_rank);
- HDsprintf(test_desc_0, "\tirregular sub set of n-cube slice through m-cube (n <= m) test %d.\n",
- test_num);
+ HDsnprintf(test_desc_0, sizeof(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 */
- 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, slice_offset, pattern_offset, (int)dim_selected[0],
- (int)dim_selected[1], (int)dim_selected[2], (int)dim_selected[3], (int)dim_selected[4],
- dims_selected);
+ HDsnprintf(test_desc_1, sizeof(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, slice_offset, pattern_offset, (int)dim_selected[0],
+ (int)dim_selected[1], (int)dim_selected[2], (int)dim_selected[3], (int)dim_selected[4],
+ dims_selected);
MESSAGE(7, (test_desc_1));
/* copy the edge size into the dims array */
@@ -12126,7 +12130,7 @@ test_space_rebuild(void)
ret = FAIL;
CHECK(ret, FAIL, "H5S_hyper_rebuild");
}
- /* No need to do shape comparision */
+ /* No need to do shape comparison */
MESSAGE(7, ("Testing functionality to rebuild 2-D hyperslab selection\n"));
/* Create 2-D dataspace */
@@ -12218,7 +12222,7 @@ test_space_rebuild(void)
ret = FAIL;
CHECK(ret, FAIL, "H5S_hyper_rebuild");
}
- /* No need to do shape comparision */
+ /* No need to do shape comparison */
MESSAGE(7, ("Testing functionality to rebuild 3-D hyperslab selection\n"));
@@ -12320,7 +12324,7 @@ test_space_rebuild(void)
ret = FAIL;
CHECK(ret, FAIL, "H5S_hyper_rebuild");
}
- /* No need to do shape comparision */
+ /* No need to do shape comparison */
MESSAGE(7, ("Testing functionality to rebuild 4-D hyperslab selection\n"));
@@ -12439,7 +12443,7 @@ test_space_rebuild(void)
ret = FAIL;
CHECK(ret, FAIL, "H5S_hyper_rebuild");
}
- /* No need to do shape comparision */
+ /* No need to do shape comparison */
MESSAGE(7, ("Testing functionality to rebuild 5-D hyperslab selection\n"));
@@ -12568,7 +12572,7 @@ test_space_rebuild(void)
ret = FAIL;
CHECK(ret, FAIL, "H5S_hyper_rebuild");
}
- /* No need to do shape comparision */
+ /* No need to do shape comparison */
/* We use 5-D to test a special case with
rebuilding routine TRUE, FALSE and TRUE */
@@ -12615,7 +12619,7 @@ test_space_rebuild(void)
ret = FAIL;
CHECK(ret, FAIL, "H5S_hyper_rebuild");
}
- /* No need to do shape comparision */
+ /* No need to do shape comparison */
/* Adding some selections to make it real irregular */
start5[3] = 1;
@@ -12643,7 +12647,7 @@ test_space_rebuild(void)
ret = FAIL;
CHECK(ret, FAIL, "H5S_hyper_rebuild");
}
- /* No need to do shape comparision */
+ /* No need to do shape comparison */
/* Add more selections to make it regular again */
start5[3] = 5;
@@ -12671,7 +12675,7 @@ test_space_rebuild(void)
ret = FAIL;
CHECK(ret, FAIL, "H5S_hyper_rebuild");
}
- /* No need to do shape comparision */
+ /* No need to do shape comparison */
H5Sclose(sid_reg1);
CHECK(ret, FAIL, "H5Sclose");
@@ -12977,7 +12981,7 @@ test_space_update_diminfo(void)
CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
} /* end if */
- /* Add block parially overlapping first, with OR */
+ /* Add block partially overlapping first, with OR */
start1[0] = 4;
count1[0] = 1;
block1[0] = 2;
@@ -13022,7 +13026,7 @@ test_space_update_diminfo(void)
CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
} /* end if */
- /* Add equally sized block parially overlapping current, with XOR */
+ /* Add equally sized block partially overlapping current, with XOR */
start1[0] = 3;
count1[0] = 1;
block1[0] = 5;
@@ -13056,7 +13060,7 @@ test_space_update_diminfo(void)
CHECK(ret, FAIL, "H5S_hyper_rebuild");
} /* end if */
- /* Add differently sized block parially overlapping current, with XOR */
+ /* Add differently sized block partially overlapping current, with XOR */
start1[0] = 4;
count1[0] = 1;
block1[0] = 5;
@@ -14232,7 +14236,7 @@ test_hyper_regular(void)
**
****************************************************************/
static void
-test_hyper_unlim_check(hid_t sid, hsize_t *dims, hssize_t enpoints, hssize_t enblocks, hsize_t *eblock1,
+test_hyper_unlim_check(hid_t sid, hsize_t *dims, hssize_t endpoints, hssize_t enblocks, hsize_t *eblock1,
hsize_t *eblock2)
{
hid_t lim_sid;
@@ -14257,7 +14261,7 @@ test_hyper_unlim_check(hid_t sid, hsize_t *dims, hssize_t enpoints, hssize_t enb
/* Check number of elements */
npoints = H5Sget_select_npoints(lim_sid);
CHECK(npoints, FAIL, "H5Sget_select_npoints");
- VERIFY(npoints, enpoints, "H5Sget_select_npoints");
+ VERIFY(npoints, endpoints, "H5Sget_select_npoints");
/* Get selection type */
sel_type = H5Sget_select_type(lim_sid);
@@ -15991,18 +15995,24 @@ test_h5s_set_extent_none(void)
void
test_select(void)
{
- hid_t plist_id; /* Property list for reading random hyperslabs */
- hid_t fapl; /* Property list accessing the file */
- int mdc_nelmts; /* Metadata number of elements */
- size_t rdcc_nelmts; /* Raw data number of elements */
- 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 */
+ hid_t plist_id; /* Property list for reading random hyperslabs */
+ hid_t fapl; /* Property list accessing the file */
+ int mdc_nelmts; /* Metadata number of elements */
+ size_t rdcc_nelmts; /* Raw data number of elements */
+ 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 */
+ const char *env_h5_drvr; /* File Driver value from environment */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Selections\n"));
+ /* Get the VFD to use */
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
+ if (env_h5_drvr == NULL)
+ env_h5_drvr = "nomatch";
+
/* Create a dataset transfer property list */
plist_id = H5Pcreate(H5P_DATASET_XFER);
CHECK(plist_id, FAIL, "H5Pcreate");
@@ -16065,10 +16075,13 @@ test_select(void)
test_select_hyper_union_3d(); /* Test hyperslab union code for 3-D dataset */
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 */
- test_select_hyper_nota_2d(); /* Test hyperslab NOTA code for 2-D dataset */
+ /* The following tests are currently broken with the Direct VFD */
+ if (HDstrcmp(env_h5_drvr, "direct") != 0) {
+ 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 */
+ test_select_hyper_nota_2d(); /* Test hyperslab NOTA code for 2-D dataset */
+ }
/* test the random hyperslab I/O with the default property list for reading */
test_select_hyper_union_random_5d(H5P_DEFAULT); /* Test hyperslab union code for random 5-D hyperslabs */
diff --git a/test/tsohm.c b/test/tsohm.c
index b4ece0b..04b9522 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -636,7 +636,7 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, hbool_t test_file_
if (GetTestExpress() > 1)
test_file_closing = FALSE;
- /* Intialize wdata */
+ /* Initialize wdata */
HDmemset(&wdata, 0, sizeof(wdata));
wdata.i1 = 11;
HDstrcpy(wdata.str, "string");
@@ -649,7 +649,7 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, hbool_t test_file_
wdata.i8 = 88;
wdata.f1 = 0.0F;
- /* Intialize rdata */
+ /* Initialize rdata */
HDmemset(&rdata, 0, sizeof(rdata));
dtype1_id = make_dtype_1();
@@ -762,7 +762,7 @@ error:
* 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
+ * Object header information from the "first" dataset in the file
* is stored in pointer `oinfo`.
*
* Programmer: Jacob Smith
@@ -1551,7 +1551,7 @@ size2_dump_struct(const char *name, size2_helper_struct *sizes)
/*-------------------------------------------------------------------------
* Function: size2_helper
*
- * Purpose: A helper functon for test_sohm_size2.
+ * Purpose: A helper function for test_sohm_size2.
*
* Creates a file using the given fcpl, then creates lots
* of different kinds of messages within the file and
@@ -1931,7 +1931,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
/*-------------------------------------------------------------------------
* Function: size2_verify
*
- * Purpose: A helper functon to verify the file created by size2_helper.
+ * Purpose: A helper function to verify the file created by size2_helper.
*
* Runs various tests (not exhaustive) to ensure that the
* file FILENAME actually has the structure that size2_helper
@@ -3815,23 +3815,45 @@ test_sohm_external_dtype(void)
void
test_sohm(void)
{
+ const char *env_h5_drvr;
+ hbool_t default_driver;
+
MESSAGE(5, ("Testing Shared Object Header Messages\n"));
- 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 */
+ /* Get the VFD to use */
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
+ if (env_h5_drvr == NULL)
+ env_h5_drvr = "nomatch";
+
+ default_driver = h5_using_default_driver(env_h5_drvr);
+
+ test_sohm_fcpl(); /* Test SOHMs and file creation plists */
+ test_sohm_fcpl_errors(); /* Bogus H5P* calls for SOHMs */
+
+ /* Only run this test with sec2/default driver */
+ if (default_driver)
+ 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
- * SOHMs, closing and reopening file after
- * each write. */
+#endif /* Jira HDFFV-10645 */
+ test_sohm_attrs(); /* Tests shared messages in attributes */
+
+ /* Only run these tests with sec2/default driver */
+ if (default_driver) {
+ test_sohm_size2(0); /* Tests the sizes of files with multiple SOHMs */
+ test_sohm_size2(1); /* Tests the sizes of files with multiple
+ * SOHMs, closing and reopening file after
+ * each write. */
+ }
+
test_sohm_delete(); /* Test deleting shared messages */
test_sohm_delete_revert(); /* Test that a file with SOHMs becomes an
* empty file again when they are deleted. */
- test_sohm_extlink(); /* Test SOHMs when external links are used */
+
+ if (!h5_driver_uses_modified_filename()) {
+ test_sohm_extlink(); /* Test SOHMs when external links are used */
+ }
test_sohm_extend_dset(); /* Test extending shared datasets */
test_sohm_external_dtype(); /* Test using datatype in another file */
diff --git a/test/ttsafe.c b/test/ttsafe.c
index 067a715..da78a7d 100644
--- a/test/ttsafe.c
+++ b/test/ttsafe.c
@@ -132,7 +132,7 @@ main(int argc, char *argv[])
TestSummary();
/* Clean up test files, if allowed */
- if (GetTestCleanup() && !HDgetenv("HDF5_NOCLEANUP"))
+ if (GetTestCleanup() && !HDgetenv(HDF5_NOCLEANUP))
TestCleanup();
/* Release test infrastructure */
diff --git a/test/ttsafe_attr_vlen.c b/test/ttsafe_attr_vlen.c
index ecd0aa6..9fafaca 100644
--- a/test/ttsafe_attr_vlen.c
+++ b/test/ttsafe_attr_vlen.c
@@ -136,7 +136,7 @@ tts_attr_vlen_thread(void H5_ATTR_UNUSED *client_data)
gid = H5Gopen2(fid, "/", H5P_DEFAULT);
CHECK(gid, H5I_INVALID_HID, "H5Gopen");
- /* Open the attribte */
+ /* Open the attribute */
aid = H5Aopen(gid, "root_attr", H5P_DEFAULT);
CHECK(aid, H5I_INVALID_HID, "H5Aopen");
diff --git a/test/tvlstr.c b/test/tvlstr.c
index 68f6124..5168d39 100644
--- a/test/tvlstr.c
+++ b/test/tvlstr.c
@@ -817,33 +817,33 @@ test_vl_rewrite(void)
/* Create in file 1 */
for (i = 0; i < REWRITE_NDATASETS; i++) {
- HDsprintf(name, "/set_%d", i);
+ HDsnprintf(name, sizeof(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++) {
- HDsprintf(name, "/set_%d", i);
+ HDsnprintf(name, sizeof(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++) {
- HDsprintf(name, "/set_%d", i);
+ HDsnprintf(name, sizeof(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++) {
- HDsprintf(name, "/set_%d", i);
+ HDsnprintf(name, sizeof(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++) {
- HDsprintf(name, "/set_%d", i);
+ HDsnprintf(name, sizeof(name), "/set_%d", i);
read_scalar_dset(file1, type, space, name, name);
write_scalar_dset(file2, type, space, name, name);
} /* end for */
diff --git a/test/tvltypes.c b/test/tvltypes.c
index 03a8ad3..0c4cf68 100644
--- a/test/tvltypes.c
+++ b/test/tvltypes.c
@@ -131,7 +131,7 @@ test_vltypes_dataset_create(void)
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
- /* Set fill value writting time to be NEVER */
+ /* Set fill value writing time to be NEVER */
ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER);
CHECK(ret, FAIL, "H5Pset_fill_time");
diff --git a/test/twriteorder.c b/test/twriteorder.c
index e792487..c58b030 100644
--- a/test/twriteorder.c
+++ b/test/twriteorder.c
@@ -54,7 +54,7 @@
*
* If the system, in which the writer and reader processes run, the readers
* will always get all chain-linked blocks correctly. If the order of write
- * is not maintained, some reader processes may found unexpect block data.
+ * is not maintained, some reader processes may found unexpected block data.
*
*************************************************************/
@@ -63,7 +63,7 @@
/* This test uses many POSIX things that are not available on
* Windows.
*/
-#ifdef H5_HAVE_UNISTD_H
+#if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)
#define DATAFILE "twriteorder.dat"
/* #define READERS_MAX 10 */ /* max number of readers */
@@ -466,7 +466,7 @@ done:
return ret_value;
}
-#else /* H5_HAVE_UNISTD_H */
+#else /* defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID) */
int
main(void)
@@ -475,4 +475,4 @@ main(void)
return EXIT_SUCCESS;
} /* end main() */
-#endif /* H5_HAVE_UNISTD_H */
+#endif /* defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID) */
diff --git a/test/unlink.c b/test/unlink.c
index 94bd035..19b7b37 100644
--- a/test/unlink.c
+++ b/test/unlink.c
@@ -617,7 +617,7 @@ test_filespace(hid_t fapl)
/* Create common objects for datasets */
- /* Create dataset creation property list for contigous storage */
+ /* Create dataset creation property list for contiguous storage */
if ((contig_dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
TEST_ERROR
@@ -1099,7 +1099,7 @@ test_filespace(hid_t fapl)
PASSED();
- /* Create simple group hiearchy, remove it & verify file size */
+ /* Create simple group hierarchy, remove it & verify file size */
TESTING(" simple group hierarchy");
/* Create file */
@@ -1138,7 +1138,7 @@ test_filespace(hid_t fapl)
PASSED();
- /* Create complex group hiearchy, remove it & verify file size */
+ /* Create complex group hierarchy, remove it & verify file size */
TESTING(" complex group hierarchy");
/* Create file */
diff --git a/test/unregister.c b/test/unregister.c
index 803f8373..ebb51b1 100644
--- a/test/unregister.c
+++ b/test/unregister.c
@@ -136,7 +136,7 @@ test_unregister_filters(hid_t fapl_id)
/* Create multiple groups under the main group */
for (i = 0; i < GROUP_ITERATION; i++) {
- HDsprintf(group_name, "group_%d", i);
+ HDsnprintf(group_name, sizeof(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)
diff --git a/test/use_append_chunk.c b/test/use_append_chunk.c
index 107615a..185cb26 100644
--- a/test/use_append_chunk.c
+++ b/test/use_append_chunk.c
@@ -63,7 +63,7 @@
/* This test uses many POSIX things that are not available on
* Windows.
*/
-#ifdef H5_HAVE_UNISTD_H
+#if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)
#include "use.h"
@@ -270,7 +270,7 @@ done:
return (ret_value);
}
-#else /* H5_HAVE_UNISTD_H */
+#else /* defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) */
int
main(void)
@@ -279,4 +279,4 @@ main(void)
return EXIT_SUCCESS;
} /* end main() */
-#endif /* H5_HAVE_UNISTD_H */
+#endif /* defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) */
diff --git a/test/use_append_mchunks.c b/test/use_append_mchunks.c
index 47c9f92..60f63c0 100644
--- a/test/use_append_mchunks.c
+++ b/test/use_append_mchunks.c
@@ -55,7 +55,7 @@
/* This test uses many POSIX things that are not available on
* Windows.
*/
-#ifdef H5_HAVE_UNISTD_H
+#if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)
#include "use.h"
@@ -265,7 +265,7 @@ done:
return (ret_value);
} /* end main() */
-#else /* H5_HAVE_UNISTD_H */
+#else /* defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) */
int
main(void)
@@ -274,4 +274,4 @@ main(void)
return EXIT_SUCCESS;
} /* end main() */
-#endif /* H5_HAVE_UNISTD_H */
+#endif /* defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) */
diff --git a/test/use_common.c b/test/use_common.c
index 8f78f3b..7b5df53 100644
--- a/test/use_common.c
+++ b/test/use_common.c
@@ -298,7 +298,7 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t *opts)
return -1;
}
- /* verify chunk_dims against set paramenters */
+ /* verify chunk_dims against set parameters */
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],
@@ -533,7 +533,7 @@ read_uc_file(hbool_t towait, options_t *opts)
/* quit when all nplanes have been read */
loops_waiting_for_plane = 0;
while (nplanes_seen < opts->nplanes) {
- /* print progress message according to if new planes are availalbe */
+ /* print progress message according to if new planes are available */
if (nplanes_seen < dims[0]) {
if (loops_waiting_for_plane) {
/* end the previous message */
diff --git a/test/use_disable_mdc_flushes.c b/test/use_disable_mdc_flushes.c
index f28e574..d40e56d 100644
--- a/test/use_disable_mdc_flushes.c
+++ b/test/use_disable_mdc_flushes.c
@@ -360,7 +360,7 @@ write_file(void)
return -1;
}
- /* verify chunk_dims against set paramenters */
+ /* verify chunk_dims against set parameters */
if (chunk_dims[0] != chunkdims_g[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],
diff --git a/test/vds.c b/test/vds.c
index ac9bb5d..4455ad4 100644
--- a/test/vds.c
+++ b/test/vds.c
@@ -196,7 +196,7 @@ vds_select_equal(hid_t space1, hid_t space2)
if (nblocks1 != nblocks2)
return FALSE;
- /* Allocate block lists. Do not return directly afer
+ /* Allocate block lists. Do not return directly after
* allocating, to make sure buffers are freed. */
if (NULL ==
(buf1 = (hsize_t *)HDmalloc((size_t)2 * (size_t)rank1 * (size_t)nblocks1 * sizeof(*buf1))))
@@ -479,7 +479,7 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, hid_t *ex
/* 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,
- * because in that case the extent of the source dset will not be corrent.
+ * because in that case the extent of the source dset will not be current.
*/
if ((*ex_dcpl != dcpl) && (config != TEST_API_REOPEN_FILE)) {
if ((tri_ret = H5Pequal(dcpl, *ex_dcpl)) < 0)
@@ -1044,7 +1044,7 @@ test_api(test_api_config_t config, hid_t fapl, H5F_libver_t low)
if ((vspace[i] = H5Screate_simple(2, dims, NULL)) < 0)
TEST_ERROR
- /* Select row in virual dataspace */
+ /* Select row in virtual dataspace */
start[0] = (hsize_t)i;
if (H5Sselect_hyperslab(vspace[i], H5S_SELECT_SET, start, NULL, count, block) < 0)
TEST_ERROR
@@ -1182,7 +1182,7 @@ test_vds_prefix_first(unsigned config, hid_t vds_fapl, hid_t src_fapl)
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 srcdset[4] = {-1, -1, -1, -1}; /* Source datasets */
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 */
@@ -1461,7 +1461,7 @@ test_basic_io(unsigned config, hid_t vds_fapl, hid_t src_fapl)
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 srcdset[4] = {-1, -1, -1, -1}; /* Source datasets */
hid_t vdset = -1; /* Virtual dataset */
hsize_t dims[4] = {10, 26, 0, 0}; /* Data space current size */
hsize_t start[4]; /* Hyperslab start */
@@ -4389,7 +4389,7 @@ test_unlim(unsigned config, hid_t vds_fapl, hid_t src_fapl)
hid_t vspace[4] = {-1, -1, -1, -1}; /* Virtual dset dataspaces */
hid_t memspace = -1; /* Memory dataspace */
hid_t filespace = -1; /* File dataspace */
- hid_t srcdset[4] = {-1, -1, -1, -1}; /* Source datsets */
+ hid_t srcdset[4] = {-1, -1, -1, -1}; /* Source datasets */
hid_t vdset = -1; /* Virtual dataset */
hsize_t dims[2] = {10, 10}; /* Data space current size */
hsize_t mdims[2] = {10, 20}; /* Data space maximum size */
@@ -7403,7 +7403,7 @@ test_printf(unsigned config, hid_t vds_fapl, hid_t src_fapl)
hid_t vspace[2] = {-1, -1}; /* Virtual dset dataspaces */
hid_t memspace = -1; /* Memory dataspace */
hid_t filespace = -1; /* File dataspace */
- hid_t srcdset[6] = {-1, -1, -1, -1, -1, -1}; /* Source datsets */
+ hid_t srcdset[6] = {-1, -1, -1, -1, -1, -1}; /* Source datasets */
hid_t vdset = -1; /* Virtual dataset */
hsize_t dims[2] = {10, 0}; /* Data space current size */
hsize_t mdims[2] = {10, 20}; /* Data space maximum size */
@@ -11111,7 +11111,7 @@ test_all(unsigned config, hid_t vds_fapl, hid_t src_fapl)
hid_t vspace[3] = {-1, -1, -1}; /* Virtual dset dataspaces */
hid_t memspace = -1; /* Memory dataspace */
hid_t filespace = -1; /* File dataspace */
- hid_t srcdset[5] = {-1, -1, -1, -1, -1}; /* Source datsets */
+ hid_t srcdset[5] = {-1, -1, -1, -1, -1}; /* Source datasets */
hid_t vdset = -1; /* Virtual dataset */
hsize_t dims[2] = {6, 6}; /* Data space current size */
hsize_t mdims[2] = {10, 10}; /* Data space maximum size */
@@ -12288,9 +12288,24 @@ main(void)
hid_t src_fapl = -1; /* File access property list */
int test_api_config;
unsigned bit_config;
- H5F_libver_t low, high; /* Low and high bounds */
+ H5F_libver_t low, high; /* Low and high bounds */
+ const char * env_h5_drvr; /* File Driver value from environment */
int nerrors = 0;
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
+ if (env_h5_drvr == NULL)
+ env_h5_drvr = "nomatch";
+
+ /*
+ * Skip VDS tests for parallel-enabled and splitter VFDs. VDS currently
+ * doesn't support parallel reads and the splitter VFD has external
+ * link-related bugs.
+ */
+ if (h5_using_parallel_driver(env_h5_drvr) || !HDstrcmp(env_h5_drvr, "splitter")) {
+ HDputs(" -- SKIPPED for incompatible VFD --");
+ HDexit(EXIT_SUCCESS);
+ }
+
/* Testing setup */
h5_reset();
fapl = h5_fileaccess();
diff --git a/test/vds_env.c b/test/vds_env.c
index 58d90fc..e01f2e0 100644
--- a/test/vds_env.c
+++ b/test/vds_env.c
@@ -58,7 +58,7 @@ test_vds_prefix_second(unsigned config, hid_t fapl)
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 srcdset[4] = {-1, -1, -1, -1}; /* Source datasets */
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 */
@@ -298,9 +298,24 @@ main(void)
{
hid_t fapl, my_fapl;
unsigned bit_config;
- H5F_libver_t low, high; /* Low and high bounds */
+ H5F_libver_t low, high; /* Low and high bounds */
+ const char * env_h5_drvr; /* File Driver value from environment */
int nerrors = 0;
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
+ if (env_h5_drvr == NULL)
+ env_h5_drvr = "nomatch";
+
+ /*
+ * Skip VDS tests for parallel-enabled and splitter VFDs. VDS currently
+ * doesn't support parallel reads and the splitter VFD has external
+ * link-related bugs.
+ */
+ if (h5_using_parallel_driver(env_h5_drvr) || !HDstrcmp(env_h5_drvr, "splitter")) {
+ HDputs(" -- SKIPPED for incompatible VFD --");
+ HDexit(EXIT_SUCCESS);
+ }
+
/* Testing setup */
h5_reset();
fapl = h5_fileaccess();
@@ -331,8 +346,9 @@ main(void)
/* 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);
+ HDsnprintf(msg, sizeof(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++) {
diff --git a/test/vfd.c b/test/vfd.c
index f4cb988..4f28766 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -48,25 +48,27 @@
#define DSET2_DIM 4
#endif /* H5_HAVE_DIRECT */
-const char *FILENAME[] = {"sec2_file", /*0*/
- "core_file", /*1*/
- "family_file", /*2*/
- "new_family_v16_", /*3*/
- "multi_file", /*4*/
- "direct_file", /*5*/
- "log_file", /*6*/
- "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*/
+const char *FILENAME[] = {"sec2_file", /*0*/
+ "core_file", /*1*/
+ "family_file", /*2*/
+ "new_family_v16", /*3*/
+ "multi_file", /*4*/
+ "direct_file", /*5*/
+ "log_file", /*6*/
+ "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*/
+ "ctl_file", /*14*/
+ "ctl_splitter_wo_file", /*15*/
NULL};
#define LOG_FILENAME "log_vfd_out.log"
-#define COMPAT_BASENAME "family_v16_"
+#define COMPAT_BASENAME "family_v16"
#define MULTI_COMPAT_BASENAME "multi_file_v16"
#define SPLITTER_DATASET_NAME "dataset"
@@ -94,6 +96,13 @@ struct splitter_dataset_def {
int n_dims; /* rank */
};
+/* Op code type enum for ctl callback test */
+typedef enum {
+ CTL_OPC_KNOWN_PASSTHROUGH, /* op code known to passthrough VFD */
+ CTL_OPC_KNOWN_TERMINAL, /* op code known to terminal VFD */
+ CTL_OPC_UNKNOWN /* unknown op code */
+} ctl_test_opc_type;
+
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);
@@ -104,6 +113,19 @@ static int splitter_RO_test(const struct splitter_dataset_def *data, hid_t child
static int splitter_tentative_open_test(hid_t child_fapl_id);
static int file_exists(const char *filename, hid_t fapl_id);
+static herr_t run_ctl_test(uint64_t op_code, uint64_t flags, ctl_test_opc_type opc_type, hid_t fapl_id);
+static H5FD_t *H5FD__ctl_test_vfd_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
+static herr_t H5FD__ctl_test_vfd_close(H5FD_t *_file);
+static haddr_t H5FD__ctl_test_vfd_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__ctl_test_vfd_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
+static haddr_t H5FD__ctl_test_vfd_get_eof(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__ctl_test_vfd_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
+ size_t size, void *buf);
+static herr_t H5FD__ctl_test_vfd_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
+ size_t size, const void *buf);
+static herr_t H5FD__ctl_test_vfd_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void *input,
+ void **output);
+
/*-------------------------------------------------------------------------
* Function: test_sec2
*
@@ -186,7 +208,7 @@ test_sec2(void)
if (os_file_handle == NULL)
FAIL_PUTS_ERROR("NULL os-specific vfd/file handle was returned from H5Fget_vfd_handle");
- /* There is no garantee the size of metadata in file is constant.
+ /* There is no guarantee the size of metadata in file is constant.
* Just try to check if it's reasonable.
*
* Currently it should be around 2 KB.
@@ -382,7 +404,7 @@ test_core(void)
if (os_file_handle == NULL)
FAIL_PUTS_ERROR("NULL os-specific vfd/file handle was returned from H5Fget_vfd_handle");
- /* There is no garantee the size of metadata in file is constant.
+ /* There is no guarantee 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.
@@ -529,7 +551,7 @@ test_core(void)
} /* end if */
/* Check file size API.
- * There is no garantee the size of metadata in file is constant.
+ * There is no guarantee 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.
@@ -1133,7 +1155,7 @@ error:
* 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. Then tools/misc/h5repart.c was
- * used to concantenated. The command was "h5repart -m 5k
+ * used to concatenated. The command was "h5repart -m 5k
* family_file%05d.h5 family_v16_%05d.h5".
*
* Return: Success: 0
@@ -1401,7 +1423,7 @@ H5_GCC_CLANG_DIAG_ON("format-nonliteral")
/*-------------------------------------------------------------------------
* Function: test_multi
*
- * Purpose: Tests the file handle interface for MUTLI driver
+ * Purpose: Tests the file handle interface for MULTI driver
*
* Return: SUCCEED/FAIL
*
@@ -2556,7 +2578,7 @@ done:
* 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.
+ * with the Splitter VFD -- specifically, Write-Only channel.
*
* Return: Success: 0
* Failure: -1
@@ -3129,7 +3151,7 @@ splitter_tentative_open_test(hid_t child_fapl_id)
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");
+ 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 mysteriously disappeared\n");
@@ -3149,7 +3171,7 @@ splitter_tentative_open_test(hid_t child_fapl_id)
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");
+ 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 mysteriously disappeared\n");
@@ -3180,7 +3202,7 @@ splitter_tentative_open_test(hid_t child_fapl_id)
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");
+ 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 mysteriously disappeared\n");
@@ -3211,7 +3233,7 @@ splitter_tentative_open_test(hid_t child_fapl_id)
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");
+ 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 mysteriously disappeared\n");
@@ -3398,6 +3420,500 @@ error:
#undef SPLITTER_TEST_FAULT
+/*
+ * Callback implementations for ctl feature testing VFD
+ */
+static H5FD_t *
+H5FD__ctl_test_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 HDcalloc(1, sizeof(H5FD_t));
+}
+static herr_t
+H5FD__ctl_test_vfd_close(H5FD_t H5_ATTR_UNUSED *_file)
+{
+ HDfree(_file);
+ return SUCCEED;
+}
+static haddr_t
+H5FD__ctl_test_vfd_get_eoa(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type)
+{
+ return HADDR_UNDEF;
+}
+static herr_t
+H5FD__ctl_test_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
+H5FD__ctl_test_vfd_get_eof(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type)
+{
+ return HADDR_UNDEF;
+}
+static herr_t
+H5FD__ctl_test_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
+H5FD__ctl_test_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 herr_t
+H5FD__ctl_test_vfd_ctl(H5FD_t H5_ATTR_UNUSED *_file, uint64_t op_code, uint64_t flags,
+ const void H5_ATTR_UNUSED *input, void H5_ATTR_UNUSED **output)
+{
+ herr_t ret_value = SUCCEED;
+
+ switch (op_code) {
+ /* Op code for testing purposes */
+ case H5FD_CTL__TEST_OPCODE:
+ break;
+
+ /* Unknown op code */
+ default:
+ if (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG)
+ ret_value = FAIL;
+ break;
+ }
+
+ return ret_value;
+}
+
+/* Minimal VFD for ctl feature tests */
+static const H5FD_class_t H5FD_ctl_test_vfd_g = {
+ (H5FD_class_value_t)201, /* value */
+ "ctl_test_vfd", /* name */
+ HADDR_MAX, /* maxaddr */
+ H5F_CLOSE_SEMI, /* 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 */
+ H5FD__ctl_test_vfd_open, /* open */
+ H5FD__ctl_test_vfd_close, /* close */
+ NULL, /* cmp */
+ NULL, /* query */
+ NULL, /* get_type_map */
+ NULL, /* alloc */
+ NULL, /* free */
+ H5FD__ctl_test_vfd_get_eoa, /* get_eoa */
+ H5FD__ctl_test_vfd_set_eoa, /* set_eoa */
+ H5FD__ctl_test_vfd_get_eof, /* get_eof */
+ NULL, /* get_handle */
+ H5FD__ctl_test_vfd_read, /* read */
+ H5FD__ctl_test_vfd_write, /* write */
+ NULL, /* flush */
+ NULL, /* truncate */
+ NULL, /* lock */
+ NULL, /* unlock */
+ NULL, /* del */
+ H5FD__ctl_test_vfd_ctl, /* ctl */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
+};
+
+/*-------------------------------------------------------------------------
+ * Function: run_ctl_test
+ *
+ * Purpose: Helper method for VFD "ctl" callback test
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+run_ctl_test(uint64_t op_code, uint64_t flags, ctl_test_opc_type opc_type, hid_t fapl_id)
+{
+ hbool_t fail_if_unknown = FALSE;
+ hbool_t routing_flag_set = FALSE;
+ hbool_t is_passthrough_vfd = FALSE;
+ hbool_t expect_fail = FALSE;
+ H5FD_t *file_drv_ptr = NULL;
+ herr_t ctl_result = SUCCEED;
+ hid_t driver_id = H5I_INVALID_HID;
+ char filename[1024];
+
+ /* Check for a few ctl function flags */
+ fail_if_unknown = (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG);
+ routing_flag_set = (flags & H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG);
+
+ /* Determine if the top-level VFD is a passthrough VFD */
+ if ((driver_id = H5Pget_driver(fapl_id)) < 0)
+ PUTS_ERROR("couldn't get VFD ID from FAPL");
+
+ is_passthrough_vfd = ((driver_id == H5FD_SPLITTER) || (driver_id == H5FD_MULTI));
+
+ /*
+ * "Open" testing file. Note that our VFD for testing the ctl
+ * feature doesn't actually create or open files, so we don't
+ * need to create the testing file; we just need the VFD to
+ * give us a pointer to a H5FD_t structure.
+ */
+ h5_fixname(FILENAME[14], fapl_id, filename, sizeof(filename));
+ if (NULL == (file_drv_ptr = H5FDopen(filename, H5F_ACC_RDWR, fapl_id, HADDR_UNDEF)))
+ PUTS_ERROR("couldn't get pointer to H5FD_t structure");
+
+ /* Determine whether the H5FDctl call is expected to fail */
+ expect_fail = fail_if_unknown && (CTL_OPC_UNKNOWN == opc_type);
+ if (is_passthrough_vfd) {
+ /* Should fail if op code is unknown to passthrough VFD
+ * (but known to terminal VFD), no routing flag is specified
+ * and the "fail if unknown" flag is specified.
+ */
+ expect_fail =
+ expect_fail || ((CTL_OPC_KNOWN_TERMINAL == opc_type) && !routing_flag_set && fail_if_unknown);
+ }
+
+ /* Issue opcode to VFD */
+ if (expect_fail) {
+ H5E_BEGIN_TRY
+ {
+ ctl_result = H5FDctl(file_drv_ptr, op_code, flags, NULL, NULL);
+ }
+ H5E_END_TRY;
+ }
+ else
+ ctl_result = H5FDctl(file_drv_ptr, op_code, flags, NULL, NULL);
+
+ /* Verify result of H5FDctl call */
+ if (expect_fail) {
+ if (ctl_result == SUCCEED)
+ PUTS_ERROR("H5FDctl call succeeded when it should have failed");
+ }
+ else {
+ if (ctl_result != SUCCEED)
+ PUTS_ERROR("H5FDctl call failed when it should have succeeded");
+ }
+
+ /* Close H5FD_t structure pointer */
+ if (H5FDclose(file_drv_ptr) < 0)
+ PUTS_ERROR("couldn't close H5FD_t structure pointer");
+ file_drv_ptr = NULL;
+
+ return 0;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ H5FDclose(file_drv_ptr);
+ }
+ H5E_END_TRY;
+
+ return -1;
+}
+
+/*-------------------------------------------------------------------------
+ * Function: test_ctl
+ *
+ * Purpose: Tests the VFD "ctl" callback
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_ctl(void)
+{
+ H5FD_splitter_vfd_config_t *splitter_config = NULL;
+ uint64_t op_code;
+ uint64_t flags;
+ hid_t driver_id = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t sub_fapl_id = H5I_INVALID_HID;
+
+ TESTING("VFD ctl callback");
+ HDputs("");
+
+ /* Register VFD for test */
+ if ((driver_id = H5FDregister(&H5FD_ctl_test_vfd_g)) < 0)
+ PUTS_ERROR("couldn't register VFD for testing");
+
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ PUTS_ERROR("couldn't create FAPL");
+ if (H5Pset_driver(fapl_id, driver_id, NULL) < 0)
+ PUTS_ERROR("couldn't set testing VFD on FAPL");
+
+ TESTING_2("known op code to terminal VFD (without fail on unknown flag)")
+
+ op_code = H5FD_CTL__TEST_OPCODE;
+ flags = 0;
+
+ /* H5FDctl call should succeed normally */
+ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("known op code to terminal VFD (with fail on unknown flag)")
+
+ op_code = H5FD_CTL__TEST_OPCODE;
+ flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG;
+
+ /* H5FDctl call should succeed normally */
+ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("known op code to terminal VFD (without fail on unknown flag/route to terminal VFD)")
+
+ op_code = H5FD_CTL__TEST_OPCODE;
+ flags = H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+
+ /* H5FDctl call should succeed normally */
+ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("known op code to terminal VFD (with fail on unknown flag/route to terminal VFD)")
+
+ op_code = H5FD_CTL__TEST_OPCODE;
+ flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG | H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+
+ /* H5FDctl call should succeed normally */
+ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("unknown op code to terminal VFD (without fail on unknown flag)")
+
+ op_code = H5FD_CTL_OPC_RESERVED;
+ flags = 0;
+
+ /* H5FDctl call should silently ignore unknown op code and succeed */
+ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("unknown op code to terminal VFD (with fail on unknown flag)")
+
+ op_code = H5FD_CTL_OPC_RESERVED;
+ flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG;
+
+ /* H5FDctl call should fail due to 'fail if unknown' flag being specified */
+ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("unknown op code to terminal VFD (without fail on unknown flag/route to terminal VFD)")
+
+ op_code = H5FD_CTL_OPC_RESERVED;
+ flags = H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+
+ /* H5FDctl call should silently ignore unknown op code and succeed */
+ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("unknown op code to terminal VFD (with fail on unknown flag/route to terminal VFD)")
+
+ op_code = H5FD_CTL_OPC_RESERVED;
+ flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG | H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+
+ /* H5FDctl call should fail due to 'fail if unknown' flag being specified */
+ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ /* Set up splitter VFD config */
+ if (NULL == (splitter_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t))))
+ TEST_ERROR;
+
+ splitter_config->magic = H5FD_SPLITTER_MAGIC;
+ splitter_config->version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
+ splitter_config->ignore_wo_errs = TRUE;
+ splitter_config->rw_fapl_id = H5P_DEFAULT;
+ splitter_config->wo_fapl_id = H5P_DEFAULT;
+ h5_fixname(FILENAME[15], splitter_config->wo_fapl_id, splitter_config->wo_path, H5FD_SPLITTER_PATH_MAX);
+
+ if ((sub_fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ PUTS_ERROR("couldn't create FAPL");
+ if (H5Pset_driver(sub_fapl_id, driver_id, NULL) < 0)
+ PUTS_ERROR("couldn't set testing VFD on FAPL");
+ splitter_config->rw_fapl_id = sub_fapl_id;
+
+ if (H5Pset_fapl_splitter(fapl_id, splitter_config) < 0)
+ PUTS_ERROR("couldn't set splitter VFD on FAPL");
+
+ TESTING_2("known op code through passthrough VFD to terminal VFD (without fail on unknown flag/no "
+ "routing flag)")
+
+ op_code = H5FD_CTL__TEST_OPCODE;
+ flags = 0;
+
+ /*
+ * H5FDctl call should silently ignore unknown op code in
+ * passthrough VFD since no routing flag is specified and
+ * 'fail if unknown' flag is not specified.
+ */
+ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2(
+ "known op code through passthrough VFD to terminal VFD (with fail on unknown flag/no routing flag)")
+
+ op_code = H5FD_CTL__TEST_OPCODE;
+ flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG;
+
+ /*
+ * H5FDctl call should fail since op code is unknown to
+ * passthrough VFD (though known to terminal VFD), no
+ * routing flag is specified and the 'fail if unknown'
+ * flag is specified.
+ */
+ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("known op code through passthrough VFD to terminal VFD (without fail on unknown flag/route to "
+ "terminal VFD)")
+
+ op_code = H5FD_CTL__TEST_OPCODE;
+ flags = H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+
+ /*
+ * H5Dctl call should succeed since the passthrough VFD
+ * doesn't recognize the op code, but has been instructed
+ * to route it down to the terminal VFD.
+ */
+ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("known op code through passthrough VFD to terminal VFD (with fail on unknown flag/route to "
+ "terminal VFD)")
+
+ op_code = H5FD_CTL__TEST_OPCODE;
+ flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG | H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+
+ /*
+ * H5Dctl call should succeed since the passthrough VFD
+ * doesn't recognize the op code, but has been instructed
+ * to route it down to the terminal VFD.
+ */
+ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("unknown op code to passthrough VFD (without fail on unknown flag)")
+
+ op_code = H5FD_CTL_OPC_RESERVED;
+ flags = 0;
+
+ /*
+ * H5FDctl call should silently ignore unknown op code in
+ * passthrough VFD since no routing flag is specified and
+ * 'fail if unknown' flag is not specified.
+ */
+ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("unknown op code to passthrough VFD (with fail on unknown flag)")
+
+ op_code = H5FD_CTL_OPC_RESERVED;
+ flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG;
+
+ /*
+ * H5FDctl call should fail since op code is unknown to
+ * passthrough VFD, no routing flag is specified and the
+ * 'fail if unknown' flag is specified.
+ */
+ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("unknown op code to passthrough VFD (without fail on unknown flag/route to terminal VFD)")
+
+ op_code = H5FD_CTL_OPC_RESERVED;
+ flags = H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+
+ /*
+ * H5Dctl call should succeed since the passthrough VFD
+ * doesn't recognize the op code, but has been instructed
+ * to route it down to the terminal VFD and the 'fail if
+ * unknown' flag has not been specified. Therefore, the
+ * terminal VFD should silently ignore the unknown op
+ * code.
+ */
+ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("unknown op code to passthrough VFD (with fail on unknown flag/route to terminal VFD)")
+
+ op_code = H5FD_CTL_OPC_RESERVED;
+ flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG | H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+
+ /*
+ * H5Dctl call should fail since the passthrough VFD
+ * doesn't recognize the op code, but has been instructed
+ * to route it down to the terminal VFD and the 'fail if
+ * unknown' flag has been specified. Therefore, the
+ * terminal VFD will throw an error for the unknown op
+ * code.
+ */
+ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("test cleanup")
+
+ HDfree(splitter_config);
+
+ if (H5FDunregister(driver_id) < 0)
+ TEST_ERROR;
+ if (H5Pclose(sub_fapl_id) < 0)
+ TEST_ERROR;
+ if (H5Pclose(fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ return 0;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ if (splitter_config)
+ HDfree(splitter_config);
+ H5FDunregister(driver_id);
+ H5Pclose(sub_fapl_id);
+ H5Pclose(fapl_id);
+ }
+ H5E_END_TRY;
+
+ return -1;
+}
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -3410,7 +3926,18 @@ error:
int
main(void)
{
- int nerrors = 0;
+ char *env_h5_drvr = NULL;
+ int nerrors = 0;
+
+ /* Don't run VFD tests when HDF5_DRIVER is set. These tests expect a
+ * specific VFD to be set and HDF5_DRIVER being set can interfere
+ * with that.
+ */
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
+ if (env_h5_drvr) {
+ HDprintf(" -- SKIPPED VFD tests because %s is set -- \n", HDF5_DRIVER);
+ HDexit(EXIT_SUCCESS);
+ }
h5_reset();
@@ -3429,6 +3956,7 @@ main(void)
nerrors += test_windows() < 0 ? 1 : 0;
nerrors += test_ros3() < 0 ? 1 : 0;
nerrors += test_splitter() < 0 ? 1 : 0;
+ nerrors += test_ctl() < 0 ? 1 : 0;
if (nerrors) {
HDprintf("***** %d Virtual File Driver TEST%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : "");
diff --git a/test/vfd_plugin.c b/test/vfd_plugin.c
new file mode 100644
index 0000000..182c048
--- /dev/null
+++ b/test/vfd_plugin.c
@@ -0,0 +1,439 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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://www.hdfgroup.org/licenses. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: Tests basic VFD plugin operations. Uses a basic testing VFD
+ * which is loaded as a dynamic plugin.
+ */
+
+#include "h5test.h"
+
+#include "null_vfd_plugin.h"
+
+#define DEFAULT_DRIVER_NAME "sec2"
+
+/*-------------------------------------------------------------------------
+ * Function: test_set_by_name()
+ *
+ * Purpose: Tests if we can load and register a VFD plugin by name.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_set_by_name(void)
+{
+ htri_t is_registered = FAIL;
+ hid_t driver_id = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+
+ TESTING("VFD plugin registration by name");
+
+ /* The null VFD should not be registered at the start of the test */
+ if ((is_registered = H5FDis_driver_registered_by_name(NULL_VFD_NAME)) < 0)
+ TEST_ERROR;
+ if (TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VFD is inappropriately registered");
+
+ /* Register the null VFD by name */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ TEST_ERROR;
+ if (H5Pset_driver_by_name(fapl_id, NULL_VFD_NAME, NULL) < 0)
+ TEST_ERROR;
+
+ /* The null VFD should be registered now */
+ if ((is_registered = H5FDis_driver_registered_by_name(NULL_VFD_NAME)) < 0)
+ TEST_ERROR;
+ if (FALSE == is_registered)
+ FAIL_PUTS_ERROR("NULL VFD was not registered");
+
+ /* Unregister the null VFD */
+ if ((driver_id = H5Pget_driver(fapl_id)) < 0)
+ TEST_ERROR;
+ if (H5FDunregister(driver_id) < 0)
+ TEST_ERROR;
+
+ /* Close FAPL, which holds last reference to null VFD */
+ if (H5Pclose(fapl_id) < 0)
+ TEST_ERROR;
+
+ /* The null VFD should not be registered now */
+ if ((is_registered = H5FDis_driver_registered_by_name(NULL_VFD_NAME)) < 0)
+ TEST_ERROR;
+ if (TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VFD is inappropriately registered");
+
+ PASSED();
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(fapl_id);
+ }
+ H5E_END_TRY;
+
+ return FAIL;
+}
+
+/*-------------------------------------------------------------------------
+ * Function: test_set_by_value()
+ *
+ * Purpose: Tests if we can load and register a VFD plugin by value
+ * (ID).
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_set_by_value(void)
+{
+ htri_t is_registered = FAIL;
+ hid_t driver_id = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+
+ TESTING("VFD plugin registration by value (ID)");
+
+ /* The null VFD should not be registered at the start of the test */
+ if ((is_registered = H5FDis_driver_registered_by_value(NULL_VFD_VALUE)) < 0)
+ TEST_ERROR;
+ if (TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VFD is inappropriately registered");
+
+ /* Register the null VFD by value */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ TEST_ERROR;
+ if (H5Pset_driver_by_value(fapl_id, NULL_VFD_VALUE, NULL) < 0)
+ TEST_ERROR;
+
+ /* The null VFD should be registered now */
+ if ((is_registered = H5FDis_driver_registered_by_value(NULL_VFD_VALUE)) < 0)
+ TEST_ERROR;
+ if (FALSE == is_registered)
+ FAIL_PUTS_ERROR("NULL VFD was not registered");
+
+ /* Unregister the null VFD */
+ if ((driver_id = H5Pget_driver(fapl_id)) < 0)
+ TEST_ERROR;
+ if (H5FDunregister(driver_id) < 0)
+ TEST_ERROR;
+
+ /* Close FAPL, which holds last reference to null VFD */
+ if (H5Pclose(fapl_id) < 0)
+ TEST_ERROR;
+
+ /* The null VFD should not be registered now */
+ if ((is_registered = H5FDis_driver_registered_by_value(NULL_VFD_VALUE)) < 0)
+ TEST_ERROR;
+ if (TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VFD is inappropriately registered");
+
+ PASSED();
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(fapl_id);
+ }
+ H5E_END_TRY;
+
+ return FAIL;
+}
+
+/*-------------------------------------------------------------------------
+ * Function: test_set_multi()
+ *
+ * Purpose: Tests if we can register a VFD plugin multiple times.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+#define N_REGISTRATIONS 10
+static herr_t
+test_set_multi(void)
+{
+ htri_t is_registered = FAIL;
+ hid_t driver_id = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ int i;
+
+ TESTING("registering a VFD plugin multiple times");
+
+ /* The null VFD should not be registered at the start of the test */
+ if ((is_registered = H5FDis_driver_registered_by_name(NULL_VFD_NAME)) < 0)
+ TEST_ERROR;
+ if (TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VFD is inappropriately registered");
+
+ /* Register the VFD multiple times */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ TEST_ERROR;
+ for (i = 0; i < N_REGISTRATIONS; i++) {
+ if (H5Pset_driver_by_name(fapl_id, NULL_VFD_NAME, NULL) < 0)
+ TEST_ERROR;
+ }
+
+ /* The null VFD should be registered now */
+ if ((is_registered = H5FDis_driver_registered_by_name(NULL_VFD_NAME)) < 0)
+ TEST_ERROR;
+ if (FALSE == is_registered)
+ FAIL_PUTS_ERROR("NULL VFD was not registered");
+
+ /* Unregister the null VFD */
+ if ((driver_id = H5Pget_driver(fapl_id)) < 0)
+ TEST_ERROR;
+ for (i = 0; i < N_REGISTRATIONS; i++) {
+ if (H5FDunregister(driver_id) < 0)
+ TEST_ERROR;
+ }
+
+ /* Close FAPL, which holds last reference to null VFD */
+ if (H5Pclose(fapl_id) < 0)
+ TEST_ERROR;
+
+ /* The null VFD should not be registered now */
+ if ((is_registered = H5FDis_driver_registered_by_name(NULL_VFD_NAME)) < 0)
+ TEST_ERROR;
+ if (TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VFD is inappropriately registered");
+
+ /* Repeat testing with the _by_value routines */
+
+ /* The null VFD should not be registered at the start of the test */
+ if ((is_registered = H5FDis_driver_registered_by_value(NULL_VFD_VALUE)) < 0)
+ TEST_ERROR;
+ if (TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VFD is inappropriately registered");
+
+ /* Register the VFD multiple times */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ TEST_ERROR;
+ for (i = 0; i < N_REGISTRATIONS; i++) {
+ if (H5Pset_driver_by_value(fapl_id, NULL_VFD_VALUE, NULL) < 0)
+ TEST_ERROR;
+ }
+
+ /* The null VFD should be registered now */
+ if ((is_registered = H5FDis_driver_registered_by_value(NULL_VFD_VALUE)) < 0)
+ TEST_ERROR;
+ if (FALSE == is_registered)
+ FAIL_PUTS_ERROR("NULL VFD was not registered");
+
+ /* Unregister the null VFD */
+ if ((driver_id = H5Pget_driver(fapl_id)) < 0)
+ TEST_ERROR;
+ for (i = 0; i < N_REGISTRATIONS; i++) {
+ if (H5FDunregister(driver_id) < 0)
+ TEST_ERROR;
+ }
+
+ /* Close FAPL, which holds last reference to null VFD */
+ if (H5Pclose(fapl_id) < 0)
+ TEST_ERROR;
+
+ /* The null VFD should not be registered now */
+ if ((is_registered = H5FDis_driver_registered_by_value(NULL_VFD_VALUE)) < 0)
+ TEST_ERROR;
+ if (TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VFD is inappropriately registered");
+
+ PASSED();
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(fapl_id);
+ }
+ H5E_END_TRY;
+
+ return FAIL;
+}
+#undef N_REGISTRATIONS
+
+/*-------------------------------------------------------------------------
+ * Function: test_get_config_str()
+ *
+ * Purpose: Tests if we can retrieve a configuration string set for a
+ * VFL driver.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_get_config_str(void)
+{
+ const char *const config_str = "{name: sec2}";
+ ssize_t config_str_len = 0;
+ hid_t fapl_id = H5I_INVALID_HID;
+ char config_str_buf[128];
+
+ TESTING("Retrieval of VFD configuration string");
+
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ TEST_ERROR;
+
+ /* Try to retrieve length of default configuration string - should be 0 */
+ HDmemset(config_str_buf, 0, 128);
+
+ if ((config_str_len = H5Pget_driver_config_str(fapl_id, config_str_buf, 128)) < 0)
+ TEST_ERROR;
+ if (0 != config_str_len)
+ TEST_ERROR;
+ if (HDstrlen(config_str_buf) > 0)
+ TEST_ERROR;
+
+ /* Set a new configuration string on the FAPL and retrieve it */
+ if (H5Pset_driver_by_name(fapl_id, DEFAULT_DRIVER_NAME, config_str) < 0)
+ TEST_ERROR;
+ if ((config_str_len = H5Pget_driver_config_str(fapl_id, config_str_buf, 128)) < 0)
+ TEST_ERROR;
+ if (HDstrlen(config_str) != config_str_len)
+ TEST_ERROR;
+ if (HDstrncmp(config_str_buf, config_str, 128))
+ TEST_ERROR;
+
+ if (H5Pclose(fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(fapl_id);
+ }
+ H5E_END_TRY;
+
+ return FAIL;
+}
+
+/*-------------------------------------------------------------------------
+ * Function: test_env_var
+ *
+ * Purpose: Tests loading of NULL VFD plugin with HDF5_DRIVER
+ * environment variable and setting of VFD configuration
+ * string with HDF5_DRIVER_CONFIG environment variable
+ *
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+test_env_var(void)
+{
+ const char *const config_str = "{name: null}";
+ ssize_t config_str_len = 0;
+ htri_t driver_is_registered;
+ char config_str_buf[128];
+
+ TESTING("Loading of VFD plugin with HDF5_DRIVER environment variable");
+
+ /* Try to retrieve length of default configuration string - should be 0 */
+ HDmemset(config_str_buf, 0, 128);
+
+ if ((config_str_len = H5Pget_driver_config_str(H5P_FILE_ACCESS_DEFAULT, config_str_buf, 128)) < 0)
+ TEST_ERROR;
+ if (0 != config_str_len)
+ TEST_ERROR;
+ if (HDstrlen(config_str_buf) > 0)
+ TEST_ERROR;
+
+ /* Set default driver and driver configuration using environment variables */
+ if (HDsetenv(HDF5_DRIVER, "null_vfd_plugin", 1) < 0)
+ TEST_ERROR;
+ if (HDsetenv(HDF5_DRIVER_CONFIG, config_str, 1) < 0)
+ TEST_ERROR;
+
+ /* Close and re-open HDF5 to have it parse the environment variables */
+ if (H5close() < 0)
+ TEST_ERROR;
+ if (H5open() < 0)
+ TEST_ERROR;
+
+ /* Check driver */
+ if ((driver_is_registered = H5FDis_driver_registered_by_name("null_vfd_plugin")) < 0)
+ TEST_ERROR;
+ if (!driver_is_registered)
+ TEST_ERROR;
+ if (H5Pget_driver(H5P_FILE_ACCESS_DEFAULT) == H5_DEFAULT_VFD)
+ TEST_ERROR;
+
+ /* Check driver configuration string */
+ HDmemset(config_str_buf, 0, 128);
+ if ((config_str_len = H5Pget_driver_config_str(H5P_FILE_ACCESS_DEFAULT, config_str_buf, 128)) < 0)
+ TEST_ERROR;
+ if (HDstrlen(config_str) != config_str_len)
+ TEST_ERROR;
+ if (HDstrncmp(config_str_buf, config_str, 128))
+ TEST_ERROR;
+
+ /* Unset environment variables */
+ if (HDsetenv(HDF5_DRIVER, "", 1) < 0)
+ TEST_ERROR;
+ if (HDsetenv(HDF5_DRIVER_CONFIG, "", 1) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ return SUCCEED;
+
+error:
+ HDsetenv(HDF5_DRIVER, "", 1);
+ HDsetenv(HDF5_DRIVER_CONFIG, "", 1);
+
+ return FAIL;
+}
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: Tests VFD plugin operations
+ *
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+ int nerrors = 0;
+
+ h5_reset();
+
+ HDputs("Testing VFD plugin functionality.");
+
+ nerrors += (test_set_by_name() < 0) ? 1 : 0;
+ nerrors += (test_set_by_value() < 0) ? 1 : 0;
+ nerrors += (test_set_multi() < 0) ? 1 : 0;
+ nerrors += (test_get_config_str() < 0) ? 1 : 0;
+ nerrors += (test_env_var() < 0) ? 1 : 0;
+
+ if (nerrors) {
+ HDprintf("***** %d VFD plugin TEST%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : "");
+ HDexit(EXIT_FAILURE);
+ }
+
+ HDputs("All VFD plugin tests passed.");
+
+ HDexit(EXIT_SUCCESS);
+}
diff --git a/test/vfd_swmr.c b/test/vfd_swmr.c
index 8255bdd..0973dd8 100644
--- a/test/vfd_swmr.c
+++ b/test/vfd_swmr.c
@@ -113,7 +113,7 @@ static unsigned test_updater_generate_md_checksums(hbool_t file_create);
* then updater_file_path field shouldn't be empty
* B) Verify that info set in the fapl is retrieved correctly.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: Vailin Choi; July 2018
@@ -307,7 +307,7 @@ error:
* used to create/open the file is the same as the
* configuration retrieved from the file's fapl.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: Vailin Choi; July 2018
@@ -639,7 +639,7 @@ error:
* Purpose: Verify the public routine H5Fvfd_swmr_end_tick() works
* as described in the RFC for VFD SWMR.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: Vailin Choi; June 2020
@@ -882,7 +882,7 @@ error:
* --Verify info in the header and index read from
* the metadata file is as expected (empty index)
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: Vailin Choi; October 2018
@@ -994,7 +994,7 @@ error:
* file is as expected:
* --num_entries and index
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: Vailin Choi; October 2018
@@ -1297,7 +1297,7 @@ test_file_end_tick_concur(void)
* Index entries are constructed at the front end by the
* writer and verified at the back end by the reader.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: Vailin Choi; October 2018
@@ -1634,7 +1634,7 @@ test_reader_md_concur(void)
/* Get the file pointer */
file_writer = H5VL_object(fid_writer);
- /* Send notification 1 to reader to start verfication */
+ /* Send notification 1 to reader to start verification */
notify = 1;
if (HDwrite(parent_pfd[1], &notify, sizeof(int)) < 0)
FAIL_STACK_ERROR;
@@ -1945,7 +1945,7 @@ error:
* Purpose: Verify the entries on the EOT queue when opening files
* with and without VFD SWMR configured.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: Vailin Choi; 11/18/2019
@@ -2258,7 +2258,7 @@ error:
* enables/disables EOT when the files are opened
* concurrently.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: Vailin Choi; June 2020
@@ -2485,7 +2485,7 @@ test_disable_enable_eot_concur(void)
if ((fid_writer = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl_writer)) < 0)
FAIL_STACK_ERROR;
- /* Send notification 1 to reader to start verfication */
+ /* Send notification 1 to reader to start verification */
notify = 1;
if (HDwrite(parent_pfd[1], &notify, sizeof(int)) < 0)
FAIL_STACK_ERROR;
@@ -2550,7 +2550,7 @@ error:
* triggers end of tick processing when the files
* are opened concurrently.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: Vailin Choi; June 2020
@@ -2759,7 +2759,7 @@ test_file_end_tick_concur(void)
if ((fid_writer = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl_writer)) < 0)
FAIL_STACK_ERROR;
- /* Send notification 1 to reader to start verfication */
+ /* Send notification 1 to reader to start verification */
notify = 1;
if (HDwrite(parent_pfd[1], &notify, sizeof(int)) < 0)
FAIL_STACK_ERROR;
@@ -2825,7 +2825,7 @@ error:
* Purpose: Verify the entries on the EOT queue when opening files
* with and without VFD SWMR configured.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: Vailin Choi; 11/18/2019
@@ -3018,7 +3018,7 @@ error:
* f: the open fails
* s: the open succeeds
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: Vailin Choi; October 2019
@@ -3420,7 +3420,7 @@ out:
* H5Fvfd_swmr_disable_end_of_tick()
* enables/disables EOT for the specified file
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: Vailin Choi; June 2020
@@ -3694,7 +3694,7 @@ error:
* Purpose: This is the helper routine used to verify whether
* "flags" in the updater file is as expected.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: Vailin Choi; October 2021
@@ -3738,7 +3738,7 @@ error:
* Purpose: Verify "flags" in the updater file is as expected for
* file creation.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: Vailin Choi; October 2021
@@ -3881,7 +3881,7 @@ error:
* Purpose: Verify "flags" in the updater file is as expected for
* multiple opens of the same file.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: Vailin Choi; October 2021
@@ -4074,7 +4074,7 @@ clean_chk_ud_files(char *md_file_path, char *updater_file_path)
* is consistent with num_change_list_entries in each updater's
* change list header
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: Vailin Choi; October 2021
@@ -4189,7 +4189,7 @@ error:
* --Generate checksum for the metadata file
* --Write the tick number and the checksum to the checksum file
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: Vailin Choi; October 2021
@@ -4288,7 +4288,7 @@ error:
* The test is invoked when the file is created via H5Fcreate()
* and via H5Fopen().
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
* Programmer: Vailin Choi; October 2021
@@ -4391,7 +4391,7 @@ error:
*
* Purpose: Main function for VFD SWMR tests.
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
*-------------------------------------------------------------------------
diff --git a/test/vfd_swmr_attrdset_writer.c b/test/vfd_swmr_attrdset_writer.c
index d015ecf..6524b8b 100644
--- a/test/vfd_swmr_attrdset_writer.c
+++ b/test/vfd_swmr_attrdset_writer.c
@@ -1123,7 +1123,7 @@ add_attr(const state_t *s, hid_t did, unsigned int which)
TEST_ERROR;
}
- /* Write to the attribure */
+ /* Write to the attribute */
if (H5Awrite(aid, tid, s->vl_attr ? &val : (const void *)&which) < 0) {
HDprintf("H5Awrite failed\n");
TEST_ERROR;
@@ -1207,7 +1207,7 @@ modify_attr(const state_t *s, hid_t did, unsigned int which)
TEST_ERROR;
}
- /* Write to the attribure */
+ /* Write to the attribute */
if (H5Awrite(aid, tid, s->vl_attr ? &val : (const void *)&tmp_val) < 0) {
HDprintf("H5Awrite failed\n");
TEST_ERROR;
@@ -1277,7 +1277,7 @@ error:
*
* Also verify continuation block and compact<->dense storage if:
* --[-c <csteps>] is 1
- * --not appliable for -m option
+ * --not applicable for -m option
*/
static bool
verify_dsets_operations(state_t *s, dsets_state_t *ds, H5F_vfd_swmr_config_t *config, np_state_t *np)
diff --git a/test/vfd_swmr_bigset_writer.c b/test/vfd_swmr_bigset_writer.c
index 8a45a87..357c3b1 100644
--- a/test/vfd_swmr_bigset_writer.c
+++ b/test/vfd_swmr_bigset_writer.c
@@ -378,7 +378,7 @@ state_init(state_t *s, int argc, char **argv)
s->vds = vds_single;
break;
case 'N':
- /* Disable named pipes, mainly for running the writer and reader seperately */
+ /* Disable named pipes, mainly for running the writer and reader separately */
s->use_named_pipe = false;
break;
case 'd':
@@ -1168,7 +1168,7 @@ error:
* --Generate checksum for the metadata file
* --Write the tick number and the checksum to the checksum file
*
- * Return: 0 if test is sucessful
+ * Return: 0 if test is successful
* 1 if test fails
*
*-------------------------------------------------------------------------
@@ -2012,7 +2012,7 @@ verify_extensible_dset(state_t *s, unsigned int which, mat_t *mat, unsigned fini
dset_id = s->dataset[which];
- /* Attempt to check the availablity of the chunks for a number times
+ /* Attempt to check the availability of the chunks for a number times
* (NUM_ATTEMPTS) before reporting it as a failure */
for (i = 0; i < NUM_ATTEMPTS; i++) {
if (H5Drefresh(dset_id) < 0) {
@@ -2543,7 +2543,7 @@ error:
int
main(int argc, char **argv)
{
- mat_t * mat;
+ mat_t * mat = NULL;
hid_t fcpl = H5I_INVALID_HID;
unsigned which;
state_t s;
diff --git a/test/vfd_swmr_check_compat.c b/test/vfd_swmr_check_compat.c
deleted file mode 100644
index b6e21a5..0000000
--- a/test/vfd_swmr_check_compat.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by Akadio, Inc. *
- * 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://www.hdfgroup.org/licenses. *
- * If you do not have access to either file, you may request a copy from *
- * help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/* Purpose: This is a small program that checks if the HDF5_DRIVER
- * environment variable is set to a value that supports VFD SWMR.
- *
- * Also checks to see if this is a parallel build, as VFD SWMR
- * and parallel HDF5 are fundamentally incompatible due to the
- * page buffer changes.
- *
- * It is intended for use in shell scripts.
- */
-
-#include "h5test.h"
-
-/* This file needs to access the file driver testing code */
-#define H5FD_FRIEND /*suppress error about including H5FDpkg */
-#define H5FD_TESTING
-#include "H5FDpkg.h" /* File drivers */
-
-/*-------------------------------------------------------------------------
- * Function: main
- *
- * Purpose: Inspects the HDF5_DRIVER environment variable, which
- * determines the VFD that the test harness will use with
- * the majority of the tests.
- *
- * Return: VFD supports SWMR: EXIT_SUCCESS
- *
- * VFD does not support SWMR
- * or failure: EXIT_FAILURE
- *
- *-------------------------------------------------------------------------
- */
-int
-main(void)
-{
-#ifdef H5_HAVE_PARALLEL
- return EXIT_FAILURE;
-#else
- char *driver = NULL;
-
- driver = HDgetenv("HDF5_DRIVER");
-
- /* Currently using SWMR support as a proxy for VFD SWMR support */
- if (H5FD__supports_swmr_test(driver))
- return EXIT_SUCCESS;
- else
- return EXIT_FAILURE;
-#endif
-
-} /* end main() */
diff --git a/test/vfd_swmr_dsetchks_writer.c b/test/vfd_swmr_dsetchks_writer.c
index c4eac7f..d649c3c 100644
--- a/test/vfd_swmr_dsetchks_writer.c
+++ b/test/vfd_swmr_dsetchks_writer.c
@@ -52,7 +52,7 @@
#define PWRITES 2 /* Writes that cover a partial chunk per write */
#define TWRITES 3 /* Writes that cover multiple chunks per write */
#define LWRITES 4 /* Writes that cover multiple partial chunks per write */
-#define INCR_EXT 5 /* Increase dataset dimenion sizes */
+#define INCR_EXT 5 /* Increase dataset dimension sizes */
#define DECR_EXT 6 /* Decrease dataset dimension sizes */
/* Fill values */
@@ -846,7 +846,7 @@ error:
*
* Dataset with fixed array/extensible array/version 2 btree index:
* --INCR_EXT: increase dataset dimension sizes
- * --DECR_EXT: decrease dataset dimenions sizes
+ * --DECR_EXT: decrease dataset dimension sizes
*/
static bool
perform_dsets_operations(state_t *s, dsets_state_t *ds, H5F_vfd_swmr_config_t *config, np_state_t *np)
@@ -1253,7 +1253,7 @@ error:
} /* write_chunks() */
/*
- * Increase or decrease the dimenion sizes for the specified datasets.
+ * Increase or decrease the dimension sizes for the specified datasets.
*/
static bool
dsets_extent(unsigned action, const state_t *s, const dsets_state_t *ds)
@@ -1827,7 +1827,7 @@ error:
} /* verify_chunks() */
/*
- * Verify the increase or decrease of dimenion sizes for the specified datasets.
+ * Verify the increase or decrease of dimension sizes for the specified datasets.
*/
static bool
verify_dsets_extent(unsigned action, const state_t *s, const dsets_state_t *ds, unsigned which)
@@ -2277,8 +2277,9 @@ error:
int
main(int argc, char **argv)
{
- hid_t fapl, fcpl;
- bool writer;
+ hid_t fapl = H5I_INVALID_HID;
+ hid_t fcpl = H5I_INVALID_HID;
+ bool writer = false;
state_t s;
const char * personality;
H5F_vfd_swmr_config_t config;
diff --git a/test/vfd_swmr_dsetops_writer.c b/test/vfd_swmr_dsetops_writer.c
index 5c7af89..7760dab 100644
--- a/test/vfd_swmr_dsetops_writer.c
+++ b/test/vfd_swmr_dsetops_writer.c
@@ -79,7 +79,7 @@ typedef struct {
bool reg_ref; /* For -R option */
bool compact; /* -p option: create compact dataset */
bool compact_write; /* -t option: write to the whole compact dataset */
- unsigned int compact_elmts; /* -e <elmts> option: # of elments for the compact dataset */
+ unsigned int compact_elmts; /* -e <elmts> option: # of elements for the compact dataset */
bool contig; /* -g option: create contiguous dataset */
bool chunked; /* -k option: create chunked datasets with 5 indexing types */
unsigned int rows; /* -m <rows> option for contiguous and/or chunked datasets */
diff --git a/test/vfd_swmr_generator.c b/test/vfd_swmr_generator.c
index 2e87c18..a78abbc 100644
--- a/test/vfd_swmr_generator.c
+++ b/test/vfd_swmr_generator.c
@@ -238,7 +238,7 @@ gen_skeleton(const char *filename, hbool_t verbose, hbool_t vfd_swmr_write, int
if (verbose)
HDfprintf(stderr, "Closing objects\n");
- /* Close everythign */
+ /* Close everything */
if (H5Pclose(dcpl) < 0)
return -1;
if (H5Sclose(sid) < 0)
diff --git a/test/vfd_swmr_gfail_writer.c b/test/vfd_swmr_gfail_writer.c
index ecda979..53b95d3 100644
--- a/test/vfd_swmr_gfail_writer.c
+++ b/test/vfd_swmr_gfail_writer.c
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Purpose: To demostrate the four issues uncovered during the test plan
+ * Purpose: To demonstrate the four issues uncovered during the test plan
* 1.4 part 1.
*
* Setup:
@@ -19,7 +19,7 @@
* 1) Create an HDF5 file
* 2) Create many groups
* 3) Use the named pipe to send the reader a message to start verifying
- * 4) Call H5Fvfd_swmr_end_tick immeidately after sending out the message to the reader
+ * 4) Call H5Fvfd_swmr_end_tick immediately after sending out the message to the reader
* 5) Sleep for two ticks before receiving a message from the reader that informs the reader
* started verifying
* 6) If the option to delete the group is off(by default), just sleep for a relatively long time,
@@ -163,7 +163,7 @@ usage(const char *progname)
"-G: old-style type of group\n"
"-n ngroups: the number of groups\n"
"-N: do not use named pipes, \n"
- " mainly for running the writer and reader seperately\n"
+ " mainly for running the writer and reader separately\n"
"-t tick_len: length of a tick in tenths of a second.\n"
"-m max_lag: maximum expected lag(in ticks) between writer and readers\n"
"-B pbs: page buffer size in bytes:\n"
diff --git a/test/vfd_swmr_gperf_writer.c b/test/vfd_swmr_gperf_writer.c
index 1d20acb..dbceace 100644
--- a/test/vfd_swmr_gperf_writer.c
+++ b/test/vfd_swmr_gperf_writer.c
@@ -1117,7 +1117,7 @@ error:
* Purpose: Add some attributes to the group.
* First, the number of attributes should be the maximal number
* of attributes that the compact storage can hold.
- * Then, add another atribute, the storage becomes dense.
+ * Then, add another attribute, the storage becomes dense.
*
* Parameters: state_t *s
* The struct that stores information of HDF5 file
@@ -1253,7 +1253,7 @@ error:
* Purpose: Add some attributes to the group and then delete one attribute.
* First, the number of attributes to be added should be the
* maximal number of attributes that the compact storage can hold.
- * Then, delete one atribute, the storage is still compact.
+ * Then, delete one attribute, the storage is still compact.
*
* Parameters: state_t *s
* The struct that stores information of HDF5 file
@@ -1299,7 +1299,7 @@ add_del_attrs_compact(state_t *s, hid_t g, hid_t gcpl, unsigned int which)
* First, the number of attributes to be added exceeds
* the maximal number of attributes that the compact storage can hold.
* The storage changes from compact to dense.
- * Then, delete one atribute, the storage is still dense.
+ * Then, delete one attribute, the storage is still dense.
*
* Parameters: state_t *s
* The struct that stores information of HDF5 file
@@ -1473,7 +1473,7 @@ del_ohr_block_attr(state_t *s, hid_t g, unsigned int which)
* Function: add_group_attribute
*
* Purpose: Check the attribute test pattern and then call the
- * correponding test function..
+ * corresponding test function.
*
* Parameters: state_t *s
* The struct that stores information of HDF5 file
@@ -2642,7 +2642,7 @@ gen_tree_struct(state_t *s, unsigned int level, unsigned ne_per_level, hid_t pgr
char name[sizeof("group-9999999999")];
unsigned int i;
- hid_t grp_id;
+ hid_t grp_id = H5I_INVALID_HID;
bool result = true;
H5G_info_t group_info;
struct timespec start_time, end_time;
@@ -2763,7 +2763,7 @@ main(int argc, char **argv)
H5F_vfd_swmr_config_t config;
bool wg_ret = false;
struct timespec start_time, end_time;
- unsigned int num_elems_per_level;
+ unsigned int num_elems_per_level = 0;
if (!state_init(&s, argc, argv)) {
printf("state_init failed\n");
@@ -2814,7 +2814,7 @@ main(int argc, char **argv)
if (s.nglevels > 0) {
if (s.grp_op_pattern != ' ' || s.at_pattern != ' ') {
printf("For nested group creation test, only the default option is supported.\n");
- printf("Please re-run the tests with the appopriate option.\n");
+ printf("Please re-run the tests with the appropriate option.\n");
TEST_ERROR;
}
}
@@ -2946,7 +2946,7 @@ main(int argc, char **argv)
fprintf(stdout, " Not using VFD SWMR \n");
if (s.old_style_grp)
- fprintf(stdout, " Groups: Created via the earlist file format(old-style) \n");
+ fprintf(stdout, " Groups: Created via the earliest file format(old-style) \n");
else
fprintf(stdout, " Groups: Created via the latest file format(new-style) \n");
diff --git a/test/vfd_swmr_group_writer.c b/test/vfd_swmr_group_writer.c
index 5952f83..00387ce 100644
--- a/test/vfd_swmr_group_writer.c
+++ b/test/vfd_swmr_group_writer.c
@@ -77,7 +77,7 @@ usage(const char *progname)
"-c steps: `steps` between communication between the writer and reader\n"
"-n ngroups: the number of groups\n"
"-N: do not use named pipes, \n"
- " mainly for running the writer and reader seperately\n"
+ " mainly for running the writer and reader separately\n"
"-u numb_ticks: `numb_ticks` for the reader to wait before verification\n"
"-t tick_len: length of a tick in tenths of a second.\n"
"-m max_lag: maximum expected lag(in ticks) between writer and readers\n"
@@ -1250,7 +1250,7 @@ error:
* Purpose: Add some attributes to the group.
* First, the number of attributes should be the maximal number
* of attributes that the compact storage can hold.
- * Then, add another atribute, the storage becomes dense.
+ * Then, add another attribute, the storage becomes dense.
*
* Parameters: state_t *s
* The struct that stores information of HDF5 file, named pipe
@@ -1430,7 +1430,7 @@ error2:
* Purpose: Add some attributes to the group and then delete one attribute.
* First, the number of attributes to be added should be the
* maximal number of attributes that the compact storage can hold.
- * Then, delete one atribute, the storage is still compact.
+ * Then, delete one attribute, the storage is still compact.
*
* Parameters: state_t *s
* The struct that stores information of HDF5 file, named pipe
@@ -1476,7 +1476,7 @@ add_del_attrs_compact(state_t *s, hid_t g, hid_t gcpl, unsigned int which)
* First, the number of attributes to be added exceeds
* the maximal number of attributes that the compact storage can hold.
* The storage changes from compact to dense.
- * Then, delete one atribute, the storage is still dense.
+ * Then, delete one attribute, the storage is still dense.
*
* Parameters: state_t *s
* The struct that stores information of HDF5 file, named pipe
@@ -1652,7 +1652,7 @@ del_ohr_block_attr(state_t *s, hid_t g, unsigned int which)
* Function: add_group_attribute
*
* Purpose: Check the attribute test pattern and then call the
- * correponding test function..
+ * corresponding test function..
*
* Parameters: state_t *s
* The struct that stores information of HDF5 file, named pipe
@@ -2020,8 +2020,8 @@ vrfy_attr(state_t *s, hid_t g, unsigned int which, const char *aname, unsigned i
}
if (read_which != which) {
- HDprintf("reader: the add_attribute verfication failed,expected value is %d\n", which);
- HDprintf("reader: the add_attribute verfication failed, the value is %d\n", read_which);
+ HDprintf("reader: the add_attribute verification failed,expected value is %d\n", which);
+ HDprintf("reader: the add_attribute verification failed, the value is %d\n", read_which);
HDprintf("The add_attribute verification failed\n");
TEST_ERROR;
}
@@ -2320,8 +2320,8 @@ verify_group_vlstr_attr(state_t *s, hid_t g, unsigned int which, bool vrfy_mod)
dbgf(1, "read attr is= %s\n", astr_val);
if (HDstrcmp(astr_val, astr_val_exp) != 0) {
- HDprintf("reader: the vl add_attribute verfication failed,expected value is %s\n", astr_val_exp);
- HDprintf("reader: the vl add_attribute verfication failed, the value is %s\n", astr_val);
+ HDprintf("reader: the vl add_attribute verification failed,expected value is %s\n", astr_val_exp);
+ HDprintf("reader: the vl add_attribute verification failed, the value is %s\n", astr_val);
HDprintf("The vl add_attribute verification failed\n");
TEST_ERROR;
}
@@ -2883,7 +2883,7 @@ verify_del_ohr_block_attr(state_t *s, hid_t g, unsigned int which)
* Function: verify_group_attribute
*
* Purpose: Check the attribute test pattern and then call the
- * correponding verification function.
+ * corresponding verification function.
*
* Parameters: state_t *s
* The struct that stores information of HDF5 file, named pipe
@@ -5147,7 +5147,7 @@ main(int argc, char **argv)
}
else {
- /* Send back the same nofity value for acknowledgement to tell the writer
+ /* Send back the same notify value for acknowledgement to tell the writer
* move to the next step. */
if (s.use_named_pipes && s.attr_test != true && s.grp_op_test != true &&
step % s.csteps == 0) {
diff --git a/test/vfd_swmr_indep_rw_writer.c b/test/vfd_swmr_indep_rw_writer.c
index 5d1be50..c3572b6 100644
--- a/test/vfd_swmr_indep_rw_writer.c
+++ b/test/vfd_swmr_indep_rw_writer.c
@@ -492,7 +492,7 @@ open_dset(state_t *s)
s->r_dsetid = dset_id;
if (i == NUM_ATTEMPTS) {
- HDfprintf(stderr, "dataset opening reachs the maximal number of attempts\n");
+ HDfprintf(stderr, "dataset opening reaches the maximal number of attempts\n");
TEST_ERROR;
}
diff --git a/test/vfd_swmr_zoo_writer.c b/test/vfd_swmr_zoo_writer.c
index 78ca06a..3efab61 100644
--- a/test/vfd_swmr_zoo_writer.c
+++ b/test/vfd_swmr_zoo_writer.c
@@ -145,7 +145,7 @@ parse_command_line_options(int argc, char **argv)
}
break;
case 'N':
- /* Disable named pipes, mainly for running the writer and reader seperately */
+ /* Disable named pipes, mainly for running the writer and reader separately */
use_named_pipe = false;
break;
case 'q':
diff --git a/test/vol.c b/test/vol.c
index c7586d5..aba9311 100644
--- a/test/vol.c
+++ b/test/vol.c
@@ -814,9 +814,11 @@ test_basic_file_operation(const char *env_h5_drvr)
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 */
+ /* Can't compare VFD properties for several VFDs */
if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
- HDstrcmp(env_h5_drvr, "family") != 0)) {
+ HDstrcmp(env_h5_drvr, "family") != 0 && HDstrcmp(env_h5_drvr, "direct") != 0 &&
+ HDstrcmp(env_h5_drvr, "core") != 0 && HDstrcmp(env_h5_drvr, "core_paged") != 0 &&
+ HDstrcmp(env_h5_drvr, "mpio") != 0 && HDstrcmp(env_h5_drvr, "splitter") != 0)) {
/* H5Fget_access_plist */
if ((fapl_id2 = H5Fget_access_plist(fid)) < 0)
TEST_ERROR;
@@ -876,9 +878,11 @@ test_basic_file_operation(const char *env_h5_drvr)
if ((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) < 0)
TEST_ERROR;
- /* Can't compare VFD properties for split / multi / family VFDs */
+ /* Can't compare VFD properties for several VFDs */
if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
- HDstrcmp(env_h5_drvr, "family") != 0)) {
+ HDstrcmp(env_h5_drvr, "family") != 0 && HDstrcmp(env_h5_drvr, "direct") != 0 &&
+ HDstrcmp(env_h5_drvr, "core") != 0 && HDstrcmp(env_h5_drvr, "core_paged") != 0 &&
+ HDstrcmp(env_h5_drvr, "mpio") != 0 && HDstrcmp(env_h5_drvr, "splitter") != 0)) {
/* H5Fget_access_plist */
if ((fapl_id2 = H5Fget_access_plist(fid)) < 0)
TEST_ERROR;
@@ -891,9 +895,11 @@ test_basic_file_operation(const char *env_h5_drvr)
if ((fid_reopen = H5Freopen(fid)) < 0)
TEST_ERROR;
- /* Can't compare VFD properties for split / multi / family VFDs */
+ /* Can't compare VFD properties for several VFDs */
if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
- HDstrcmp(env_h5_drvr, "family") != 0)) {
+ HDstrcmp(env_h5_drvr, "family") != 0 && HDstrcmp(env_h5_drvr, "direct") != 0 &&
+ HDstrcmp(env_h5_drvr, "core") != 0 && HDstrcmp(env_h5_drvr, "core_paged") != 0 &&
+ HDstrcmp(env_h5_drvr, "mpio") != 0 && HDstrcmp(env_h5_drvr, "splitter") != 0)) {
/* H5Fget_access_plist */
if ((fapl_id2 = H5Fget_access_plist(fid_reopen)) < 0)
TEST_ERROR;
@@ -942,7 +948,7 @@ error:
*-------------------------------------------------------------------------
*/
static herr_t
-test_basic_group_operation(void)
+test_basic_group_operation(const char *env_h5_drvr)
{
hid_t fid = H5I_INVALID_HID;
hid_t fapl_id = H5I_INVALID_HID;
@@ -985,9 +991,10 @@ test_basic_group_operation(void)
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;
+ /* H5Gflush - skip for MPIO file driver as flush calls cause assertions in the library */
+ if (HDstrcmp(env_h5_drvr, "mpio") != 0)
+ if (H5Gflush(gid) < 0)
+ TEST_ERROR;
/* H5Gclose */
if (H5Gclose(gid) < 0)
@@ -1045,7 +1052,7 @@ error:
*-------------------------------------------------------------------------
*/
static herr_t
-test_basic_dataset_operation(void)
+test_basic_dataset_operation(const char *env_h5_drvr)
{
hid_t fid = H5I_INVALID_HID;
hid_t fapl_id = H5I_INVALID_HID;
@@ -1110,9 +1117,10 @@ test_basic_dataset_operation(void)
if (H5Dset_extent(did, &curr_dims) < 0)
TEST_ERROR;
- /* H5Dflush */
- if (H5Dflush(did) < 0)
- TEST_ERROR;
+ /* H5Dflush - skip for MPIO file driver as flush calls cause assertions in the library */
+ if (HDstrcmp(env_h5_drvr, "mpio") != 0)
+ if (H5Dflush(did) < 0)
+ TEST_ERROR;
/* H5Dwrite */
if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, in_buf) < 0)
@@ -1384,10 +1392,10 @@ test_basic_object_operation(void)
if (H5Oclose(oid) < 0)
TEST_ERROR;
- if (H5Fclose(fid) < 0)
- TEST_ERROR;
if (H5Gclose(gid) < 0)
TEST_ERROR;
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
h5_delete_test_file(FILENAME[0], fapl_id);
@@ -1463,10 +1471,10 @@ test_basic_link_operation(void)
H5P_DEFAULT) < 0)
TEST_ERROR;
- if (H5Fclose(fid) < 0)
- TEST_ERROR;
if (H5Gclose(gid) < 0)
TEST_ERROR;
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
h5_delete_test_file(FILENAME[0], fapl_id);
@@ -1500,7 +1508,7 @@ error:
*-------------------------------------------------------------------------
*/
static herr_t
-test_basic_datatype_operation(void)
+test_basic_datatype_operation(const char *env_h5_drvr)
{
hid_t fid = H5I_INVALID_HID;
hid_t fapl_id = H5I_INVALID_HID;
@@ -1524,9 +1532,10 @@ test_basic_datatype_operation(void)
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;
+ /* H5Tflush - skip for MPIO file driver as flush calls cause assertions in the library */
+ if (HDstrcmp(env_h5_drvr, "mpio") != 0)
+ if (H5Tflush(tid) < 0)
+ TEST_ERROR;
/* H5Trefresh */
if (H5Trefresh(tid) < 0)
@@ -1975,11 +1984,11 @@ test_async_vol_props(void)
FAIL_STACK_ERROR;
/* Override possible environment variable & re-initialize default VOL connector */
- conn_env_str = HDgetenv("HDF5_VOL_CONNECTOR");
+ conn_env_str = HDgetenv(HDF5_VOL_CONNECTOR);
if (conn_env_str) {
if (NULL == (conn_env_str = HDstrdup(conn_env_str)))
TEST_ERROR
- if (HDunsetenv("HDF5_VOL_CONNECTOR") < 0)
+ if (HDunsetenv(HDF5_VOL_CONNECTOR) < 0)
TEST_ERROR
if (H5VL__reparse_def_vol_conn_variable_test() < 0)
TEST_ERROR
@@ -2004,7 +2013,7 @@ test_async_vol_props(void)
FAIL_STACK_ERROR;
/* Set environment variable to use 'fake async' connector & re-init default connector */
- if (HDsetenv("HDF5_VOL_CONNECTOR", "fake_async", TRUE) < 0)
+ if (HDsetenv(HDF5_VOL_CONNECTOR, "fake_async", TRUE) < 0)
TEST_ERROR
if (H5VL__reparse_def_vol_conn_variable_test() < 0)
TEST_ERROR
@@ -2022,7 +2031,7 @@ test_async_vol_props(void)
TEST_ERROR
/* Reset environment variable & re-init default connector */
- if (HDunsetenv("HDF5_VOL_CONNECTOR") < 0)
+ if (HDunsetenv(HDF5_VOL_CONNECTOR) < 0)
TEST_ERROR
if (H5VL__reparse_def_vol_conn_variable_test() < 0)
TEST_ERROR
@@ -2072,7 +2081,7 @@ test_async_vol_props(void)
/* Restore environment variable, if there was one */
if (conn_env_str) {
- if (HDsetenv("HDF5_VOL_CONNECTOR", conn_env_str, TRUE) < 0)
+ if (HDsetenv(HDF5_VOL_CONNECTOR, conn_env_str, TRUE) < 0)
TEST_ERROR
HDfree(conn_env_str);
@@ -2112,7 +2121,7 @@ main(void)
int nerrors = 0;
/* Get the VFD to use */
- env_h5_drvr = HDgetenv("HDF5_DRIVER");
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
if (env_h5_drvr == NULL)
env_h5_drvr = "nomatch";
@@ -2124,12 +2133,12 @@ main(void)
nerrors += test_register_opt_operation() < 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_group_operation(env_h5_drvr) < 0 ? 1 : 0;
+ nerrors += test_basic_dataset_operation(env_h5_drvr) < 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;
+ nerrors += test_basic_datatype_operation(env_h5_drvr) < 0 ? 1 : 0;
nerrors += test_async_vol_props() < 0 ? 1 : 0;
if (nerrors) {
diff --git a/test/vol_plugin.c b/test/vol_plugin.c
index 7656870..c7baf5a 100644
--- a/test/vol_plugin.c
+++ b/test/vol_plugin.c
@@ -150,8 +150,8 @@ error:
static herr_t
test_multiple_registration(void)
{
- htri_t is_registered = FAIL;
- hid_t vol_ids[N_REGISTRATIONS];
+ htri_t is_registered = FAIL;
+ hid_t vol_ids[N_REGISTRATIONS] = {0};
int i;
TESTING("registering a VOL connector multiple times");