summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt46
-rw-r--r--test/CMakeTests.cmake2
-rw-r--r--test/CMakeVFDTests.cmake77
-rw-r--r--test/cross_read.c13
-rw-r--r--test/dsets.c13
-rw-r--r--test/dtypes.c36
-rw-r--r--test/file_image.c5
-rw-r--r--test/fillval.c6
-rw-r--r--test/flush2.c11
-rw-r--r--test/getname.c14
-rw-r--r--test/h5test.c104
-rw-r--r--test/h5test.h4
-rw-r--r--test/lheap.c6
-rw-r--r--test/links.c20
-rw-r--r--test/mf.c3
-rw-r--r--test/mtime.c9
-rw-r--r--test/ntypes.c14
-rw-r--r--test/objcopy.c9
-rw-r--r--test/set_extent.c8
-rw-r--r--test/stab.c11
-rw-r--r--test/tarray.c16
-rw-r--r--test/tfile.c141
-rw-r--r--test/th5s.c8
-rw-r--r--test/titerate.c15
-rw-r--r--test/tmisc.c151
-rw-r--r--test/tsohm.c17
-rw-r--r--test/vds.c14
-rw-r--r--test/vds_env.c14
-rw-r--r--test/vol.c46
29 files changed, 544 insertions, 289 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 2026528..5bccc81 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -30,7 +30,7 @@ set (TEST_LIB_HEADERS
if (NOT ONLY_SHARED_LIBS)
add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS})
target_include_directories (${HDF5_TEST_LIB_TARGET}
- PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
+ PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
target_compile_options(${HDF5_TEST_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
@@ -52,7 +52,7 @@ endif ()
if (BUILD_SHARED_LIBS)
add_library (${HDF5_TEST_LIBSH_TARGET} SHARED ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS})
target_include_directories (${HDF5_TEST_LIBSH_TARGET}
- PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
+ PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
target_compile_options(${HDF5_TEST_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
@@ -109,7 +109,7 @@ if (BUILD_SHARED_LIBS)
set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME})
add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c)
- target_include_directories (${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED)
target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED "LIB")
@@ -141,7 +141,7 @@ if (BUILD_SHARED_LIBS)
set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME})
add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c)
- target_include_directories (${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED)
target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED "LIB")
@@ -185,7 +185,7 @@ if (BUILD_SHARED_LIBS)
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_include_directories (${HDF5_VFD_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${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")
@@ -229,7 +229,7 @@ if (BUILD_SHARED_LIBS)
set (HDF5_VOL_PLUGIN_LIB_TARGET ${HDF5_VOL_PLUGIN_LIB_CORENAME})
add_library (${HDF5_VOL_PLUGIN_LIB_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${vol_lib}.c)
- target_include_directories (${HDF5_VOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (${HDF5_VOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${HDF5_VOL_PLUGIN_LIB_TARGET} SHARED)
target_link_libraries (${HDF5_VOL_PLUGIN_LIB_TARGET} PUBLIC ${HDF5_TEST_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${HDF5_VOL_PLUGIN_LIB_TARGET} ${HDF5_VOL_PLUGIN_LIB_NAME} SHARED "LIB")
@@ -388,7 +388,7 @@ endif ()
macro (ADD_H5_EXE file)
add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c)
- target_include_directories (${file} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (${file} PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (${file} STATIC)
@@ -430,7 +430,7 @@ endforeach ()
#-- Adding test for chunk_info
add_executable (chunk_info ${HDF5_TEST_SOURCE_DIR}/chunk_info.c)
target_compile_options(chunk_info PRIVATE "${HDF5_CMAKE_C_FLAGS}")
-target_include_directories (chunk_info PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+target_include_directories (chunk_info PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (chunk_info STATIC)
target_link_libraries (chunk_info PRIVATE ${HDF5_TEST_LIB_TARGET} ${LINK_COMP_LIBS})
@@ -450,7 +450,7 @@ endif ()
#-- Adding test for direct_chunk
add_executable (direct_chunk ${HDF5_TEST_SOURCE_DIR}/direct_chunk.c)
target_compile_options(direct_chunk PRIVATE "${HDF5_CMAKE_C_FLAGS}")
-target_include_directories (direct_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+target_include_directories (direct_chunk PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (direct_chunk STATIC)
target_link_libraries (direct_chunk PRIVATE ${HDF5_TEST_LIB_TARGET} ${LINK_COMP_LIBS})
@@ -471,7 +471,7 @@ endif ()
#-- Adding test for testhdf5
add_executable (testhdf5 ${testhdf5_SOURCES})
target_compile_options(testhdf5 PRIVATE "${HDF5_CMAKE_C_FLAGS}")
-target_include_directories (testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+target_include_directories (testhdf5 PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (testhdf5 STATIC)
target_link_libraries (testhdf5 PRIVATE ${HDF5_TEST_LIB_TARGET})
@@ -491,7 +491,7 @@ endif ()
#-- Adding test for cache_image
add_executable (cache_image ${cache_image_SOURCES})
target_compile_options(cache_image PRIVATE "${HDF5_CMAKE_C_FLAGS}")
-target_include_directories (cache_image PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+target_include_directories (cache_image PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (cache_image STATIC)
target_link_libraries (cache_image PRIVATE ${HDF5_TEST_LIB_TARGET})
@@ -511,7 +511,7 @@ endif ()
#-- Adding test for ttsafe
add_executable (ttsafe ${ttsafe_SOURCES})
target_compile_options(ttsafe PRIVATE "${HDF5_CMAKE_C_FLAGS}")
-target_include_directories (ttsafe PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+target_include_directories (ttsafe PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (ttsafe STATIC)
target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIB_TARGET})
@@ -537,7 +537,7 @@ endif ()
#-- Adding test for thread_id
add_executable (thread_id ${HDF5_TEST_SOURCE_DIR}/thread_id.c)
target_compile_options(thread_id PRIVATE "${HDF5_CMAKE_C_FLAGS}")
-target_include_directories (thread_id PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+target_include_directories (thread_id PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (thread_id STATIC)
target_link_libraries (thread_id PRIVATE ${HDF5_TEST_LIB_TARGET})
@@ -562,7 +562,7 @@ 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}>")
+ target_include_directories (mirror_vfd PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${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})
@@ -641,7 +641,7 @@ set (H5_VDS_SWMR_TESTS
macro (ADD_H5_VDS_EXE file)
add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c ${HDF5_TEST_SOURCE_DIR}/vds_swmr.h)
- target_include_directories (${file} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (${file} PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (${file} STATIC)
@@ -669,7 +669,7 @@ endforeach ()
# and it can't be renamed (i.e., no <foo>-shared).
add_executable (accum_swmr_reader ${HDF5_TEST_SOURCE_DIR}/accum_swmr_reader.c)
target_compile_options(accum_swmr_reader PRIVATE "${HDF5_CMAKE_C_FLAGS}")
-target_include_directories (accum_swmr_reader PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+target_include_directories (accum_swmr_reader PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (accum_swmr_reader STATIC)
target_link_libraries (accum_swmr_reader PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
@@ -694,7 +694,7 @@ set_target_properties (accum PROPERTIES DEPENDS accum_swmr_reader)
##############################################################################
if (BUILD_SHARED_LIBS)
add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c)
- target_include_directories (filter_plugin PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (filter_plugin PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (filter_plugin SHARED)
target_link_libraries (filter_plugin PRIVATE ${HDF5_TEST_LIBSH_TARGET})
set_target_properties (filter_plugin PROPERTIES FOLDER test)
@@ -707,7 +707,7 @@ if (BUILD_SHARED_LIBS)
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_include_directories (vfd_plugin PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${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)
@@ -720,7 +720,7 @@ if (BUILD_SHARED_LIBS)
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_include_directories (vol_plugin PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (vol_plugin SHARED)
target_link_libraries (vol_plugin PRIVATE ${HDF5_TEST_LIBSH_TARGET})
set_target_properties (vol_plugin PROPERTIES FOLDER test)
@@ -739,7 +739,7 @@ endif ()
set (use_append_chunk_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk.c ${HDF5_TEST_SOURCE_DIR}/use_common.c ${HDF5_TEST_SOURCE_DIR}/use.h)
add_executable (use_append_chunk ${use_append_chunk_SOURCES})
target_compile_options(use_append_chunk PRIVATE "${HDF5_CMAKE_C_FLAGS}")
-target_include_directories (use_append_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+target_include_directories (use_append_chunk PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (use_append_chunk STATIC)
target_link_libraries (use_append_chunk PRIVATE ${HDF5_TEST_LIB_TARGET})
@@ -760,7 +760,7 @@ 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}>")
+ target_include_directories (use_append_chunk_mirror PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${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})
@@ -781,7 +781,7 @@ 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)
add_executable (use_append_mchunks ${use_append_mchunks_SOURCES})
target_compile_options(use_append_mchunks PRIVATE "${HDF5_CMAKE_C_FLAGS}")
-target_include_directories (use_append_mchunks PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+target_include_directories (use_append_mchunks PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (use_append_mchunks STATIC)
target_link_libraries (use_append_mchunks PRIVATE ${HDF5_TEST_LIB_TARGET})
@@ -801,7 +801,7 @@ endif ()
set (use_disable_mdc_flushes_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_disable_mdc_flushes.c)
add_executable (use_disable_mdc_flushes ${use_disable_mdc_flushes_SOURCES})
target_compile_options(use_disable_mdc_flushes PRIVATE "${HDF5_CMAKE_C_FLAGS}")
-target_include_directories (use_disable_mdc_flushes PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+target_include_directories (use_disable_mdc_flushes PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (use_disable_mdc_flushes STATIC)
target_link_libraries (use_disable_mdc_flushes PRIVATE ${HDF5_TEST_LIB_TARGET})
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index 72f7a8d..a0a0b01 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -945,7 +945,7 @@ endif ()
if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
macro (ADD_H5_GENERATOR genfile)
add_executable (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c)
- target_include_directories (${genfile} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (${genfile} PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${genfile} STATIC)
target_link_libraries (${genfile} PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (${genfile} PROPERTIES FOLDER generator/test)
diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake
index b371753..7648166 100644
--- a/test/CMakeVFDTests.cmake
+++ b/test/CMakeVFDTests.cmake
@@ -72,6 +72,35 @@ add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HD
external_env
vds_env
)
+
+ # Skip several tests with subfiling VFD, mostly due
+ # to no support for collective I/O
+ set (H5_VFD_subfiling_SKIP_TESTS
+ cache_api
+ chunk_info
+ cmpd_dset
+ cork
+ dangle
+ direct_chunk
+ dsets
+ dt_arith
+ dtransform
+ extend
+ fillval
+ filter_fail
+ istore
+ links
+ mf
+ objcopy
+ objcopy_ref
+ ohdr
+ set_extent
+ testhdf5
+ unlink
+ unregister
+ vol
+ )
+
if (NOT CYGWIN)
list (REMOVE_ITEM H5_VFD_SKIP_TESTS big cache)
endif ()
@@ -138,21 +167,23 @@ add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HD
endmacro ()
macro (DO_VFD_TEST vfdtest vfdname resultcode)
- add_test (NAME VFD-${vfdname}-${vfdtest}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>"
- -D "TEST_ARGS:STRING="
- -D "TEST_VFD:STRING=${vfdname}"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=${vfdname}-${vfdtest}.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
- -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
- )
+ if (NOT "${vfdtest}" IN_LIST H5_VFD_${vfdname}_SKIP_TESTS)
+ add_test (NAME VFD-${vfdname}-${vfdtest}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_VFD:STRING=${vfdname}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=${vfdname}-${vfdtest}.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
+ -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
+ )
+ set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
+ )
+ endif ()
endmacro ()
macro (ADD_VFD_TEST vfdname resultcode)
@@ -165,10 +196,18 @@ add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HD
endif ()
endif ()
endforeach ()
- set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES DEPENDS VFD-${vfdname}-flush1)
- set_tests_properties (VFD-${vfdname}-flush1 PROPERTIES TIMEOUT 10)
- set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10)
- set_tests_properties (VFD-${vfdname}-istore PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
+ if (NOT "flush2" IN_LIST H5_VFD_${vfdname}_SKIP_TESTS)
+ if (NOT "flush1" IN_LIST H5_VFD_${vfdname}_SKIP_TESTS)
+ set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES DEPENDS VFD-${vfdname}-flush1)
+ endif ()
+ set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10)
+ endif ()
+ if (NOT "flush1" IN_LIST H5_VFD_${vfdname}_SKIP_TESTS)
+ set_tests_properties (VFD-${vfdname}-flush1 PROPERTIES TIMEOUT 10)
+ endif ()
+ if (NOT "istore" IN_LIST H5_VFD_${vfdname}_SKIP_TESTS)
+ set_tests_properties (VFD-${vfdname}-istore PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
+ endif ()
if (NOT CYGWIN)
set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
endif ()
diff --git a/test/cross_read.c b/test/cross_read.c
index 85845e0..7b3a214 100644
--- a/test/cross_read.c
+++ b/test/cross_read.c
@@ -354,15 +354,20 @@ error:
int
main(void)
{
- char filename[1024];
- int nerrors = 0;
+ hbool_t driver_is_default_compatible;
+ char filename[1024];
+ int nerrors = 0;
h5_reset();
/*
- * Skip tests for VFDs that need modified filenames.
+ * Skip tests for VFDs that aren't compatible with default VFD.
*/
- if (h5_driver_uses_modified_filename()) {
+ if (h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible) < 0) {
+ HDputs(" -- couldn't check if VFD is compatible with default VFD --");
+ HDexit(EXIT_SUCCESS);
+ }
+ if (!driver_is_default_compatible) {
HDputs(" -- SKIPPED for incompatible VFD --");
HDexit(EXIT_SUCCESS);
}
diff --git a/test/dsets.c b/test/dsets.c
index c1ac3ec..91f6315 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -15585,7 +15585,7 @@ main(void)
int nerrors = 0;
const char *envval;
hbool_t contig_addr_vfd; /* Whether VFD used has a contiguous address space */
- hbool_t driver_uses_modified_filename = h5_driver_uses_modified_filename();
+ hbool_t driver_is_default_compatible;
int i;
/* Don't run this test using certain file drivers */
@@ -15636,6 +15636,9 @@ main(void)
h5_reset();
fapl = h5_fileaccess();
+ if (h5_driver_is_default_vfd_compatible(fapl, &driver_is_default_compatible) < 0)
+ TEST_ERROR;
+
/* Turn off the chunk cache, so all the chunks are immediately written to disk */
if (H5Pget_cache(fapl, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0)
goto error;
@@ -15747,7 +15750,7 @@ main(void)
nerrors += (test_types(file) < 0 ? 1 : 0);
nerrors += (test_userblock_offset(envval, my_fapl, new_format) < 0 ? 1 : 0);
- if (!driver_uses_modified_filename) {
+ if (driver_is_default_compatible) {
nerrors += (test_missing_filter(file) < 0 ? 1 : 0);
}
@@ -15760,7 +15763,7 @@ main(void)
nerrors += (test_copy_dcpl(file, my_fapl) < 0 ? 1 : 0);
nerrors += (test_filter_delete(file) < 0 ? 1 : 0);
- if (!driver_uses_modified_filename) {
+ if (driver_is_default_compatible) {
nerrors += (test_filters_endianess() < 0 ? 1 : 0);
}
@@ -15782,7 +15785,7 @@ main(void)
nerrors += (test_layout_extend(my_fapl) < 0 ? 1 : 0);
nerrors += (test_fixed_array(my_fapl) < 0 ? 1 : 0);
- if (!driver_uses_modified_filename) {
+ if (driver_is_default_compatible) {
nerrors += (test_idx_compatible() < 0 ? 1 : 0);
}
@@ -15819,7 +15822,7 @@ main(void)
nerrors += (test_gather_error() < 0 ? 1 : 0);
/* Tests version bounds using its own file */
- if (!driver_uses_modified_filename) {
+ if (driver_is_default_compatible) {
nerrors += (test_versionbounds() < 0 ? 1 : 0);
}
diff --git a/test/dtypes.c b/test/dtypes.c
index f322d03..4aebed8 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -3661,6 +3661,7 @@ test_compound_18(void)
hsize_t dim = 1;
const char *testfile = H5_get_srcdir_filename(TESTFILE); /* Corrected test file name */
char filename[1024];
+ hbool_t driver_is_default_compatible;
herr_t ret;
TESTING("accessing objects with compound datatypes that have no fields");
@@ -3725,7 +3726,10 @@ test_compound_18(void)
if (H5Fclose(file) < 0)
FAIL_STACK_ERROR;
- if (!h5_driver_uses_modified_filename()) {
+ if (h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible) < 0)
+ FAIL_PUTS_ERROR("can't check if VFD is default VFD compatible");
+
+ if (driver_is_default_compatible) {
/* Open Generated File */
/* (generated with gen_bad_compound.c) */
if ((file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
@@ -8782,8 +8786,9 @@ error:
int
main(void)
{
- long nerrors = 0;
- hid_t fapl = H5I_INVALID_HID;
+ hbool_t driver_is_parallel;
+ long nerrors = 0;
+ hid_t fapl = H5I_INVALID_HID;
/* Set the random # seed */
HDsrandom((unsigned)HDtime(NULL));
@@ -8791,6 +8796,11 @@ main(void)
reset_hdf5();
fapl = h5_fileaccess();
+ if (h5_using_parallel_driver(fapl, &driver_is_parallel) < 0) {
+ HDprintf("Can't check if driver is parallel-enabled\n");
+ HDexit(EXIT_FAILURE);
+ }
+
if (ALIGNMENT)
HDprintf("Testing non-aligned conversions (ALIGNMENT=%d)....\n", ALIGNMENT);
@@ -8827,12 +8837,20 @@ main(void)
nerrors += test_compound_6();
nerrors += test_compound_7();
nerrors += test_compound_8();
- nerrors += test_compound_9();
- nerrors += test_compound_10();
+
+ if (!driver_is_parallel) {
+ nerrors += test_compound_9();
+ nerrors += test_compound_10();
+ }
+
nerrors += test_compound_11();
nerrors += test_compound_12();
nerrors += test_compound_13();
- nerrors += test_compound_14();
+
+ if (!driver_is_parallel) {
+ nerrors += test_compound_14();
+ }
+
nerrors += test_compound_15();
nerrors += test_compound_16();
nerrors += test_compound_17();
@@ -8843,7 +8861,11 @@ main(void)
nerrors += test_bitfield_funcs();
nerrors += test_opaque();
nerrors += test_set_order();
- nerrors += test_utf_ascii_conv();
+
+ if (!driver_is_parallel) {
+ nerrors += test_utf_ascii_conv();
+ }
+
nerrors += test_versionbounds();
if (nerrors) {
diff --git a/test/file_image.c b/test/file_image.c
index 45a2fa9..1ac39c3 100644
--- a/test/file_image.c
+++ b/test/file_image.c
@@ -1353,6 +1353,7 @@ main(void)
{
int errors = 0;
hid_t fapl;
+ hbool_t driver_is_default_compatible;
unsigned user;
h5_reset();
@@ -1362,7 +1363,9 @@ main(void)
errors += test_properties();
errors += test_callbacks();
- if (!h5_driver_uses_modified_filename()) {
+ if (h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible) < 0)
+ errors++;
+ else if (driver_is_default_compatible) {
errors += test_core();
}
diff --git a/test/fillval.c b/test/fillval.c
index 9c2e2a3..e5a2133 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -2663,6 +2663,7 @@ main(int argc, char *argv[])
int nerrors = 0, argno, test_contig = 1, test_chunk = 1, test_compact = 1;
hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */
unsigned new_format; /* Whether to use the new format or not */
+ hbool_t driver_is_default_compatible;
if (argc >= 2) {
test_contig = test_chunk = test_compact = 0;
@@ -2683,6 +2684,9 @@ main(int argc, char *argv[])
h5_reset();
fapl = h5_fileaccess();
+ if (h5_driver_is_default_vfd_compatible(fapl, &driver_is_default_compatible) < 0)
+ TEST_ERROR;
+
/* Property list tests */
nerrors += test_getset();
nerrors += test_getset_vl(fapl);
@@ -2723,7 +2727,7 @@ main(int argc, char *argv[])
nerrors += test_rdwr(my_fapl, FILENAME[3], H5D_CONTIGUOUS);
nerrors += test_extend(my_fapl, FILENAME[5], H5D_CONTIGUOUS);
- if (!h5_driver_uses_modified_filename()) {
+ if (driver_is_default_compatible) {
nerrors += test_compatible();
}
} /* end if */
diff --git a/test/flush2.c b/test/flush2.c
index 6965cef..99cad14 100644
--- a/test/flush2.c
+++ b/test/flush2.c
@@ -245,6 +245,7 @@ main(void)
char filename[1024]; /* filename */
hbool_t check_second_dset; /* whether or not to check the second dset */
H5E_auto2_t func; /* for shutting off error reporting */
+ hbool_t driver_is_default_vfd_compatible;
h5_reset();
if ((fapl_id = h5_fileaccess()) < 0)
@@ -254,6 +255,16 @@ main(void)
driver = HDgetenv(HDF5_DRIVER);
vfd_supports_swmr = H5FD__supports_swmr_test(driver);
+ if (h5_driver_is_default_vfd_compatible(fapl_id, &driver_is_default_vfd_compatible) < 0) {
+ HDprintf("Can't check if VFD is compatible with default VFD\n");
+ HDexit(EXIT_FAILURE);
+ }
+
+ if (!driver_is_default_vfd_compatible) {
+ HDprintf("Skipping SWMR tests for VFD incompatible with default VFD\n");
+ HDexit(EXIT_SUCCESS);
+ }
+
/* TEST 1 */
/* Check the case where the file was flushed */
TESTING("H5Fflush (part2 with flush)");
diff --git a/test/getname.c b/test/getname.c
index 877e567..c7d822e 100644
--- a/test/getname.c
+++ b/test/getname.c
@@ -3757,16 +3757,20 @@ error:
int
main(void)
{
- hid_t file_id = (-1);
- int nerrors = 0;
- hid_t fapl;
- char filename0[1024];
+ hid_t file_id = (-1);
+ int nerrors = 0;
+ hid_t fapl;
+ char filename0[1024];
+ hbool_t driver_is_parallel;
/* Reset the library and get the file access property list */
h5_reset();
fapl = h5_fileaccess();
h5_fixname(FILENAME[0], fapl, filename0, sizeof filename0);
+ if (h5_using_parallel_driver(fapl, &driver_is_parallel) < 0)
+ TEST_ERROR;
+
/* Create a new file_id using default create property but vfd access
* property.
*/
@@ -3776,7 +3780,7 @@ main(void)
/* Call "main" test routine */
nerrors += test_main(file_id, fapl);
- if (!h5_using_parallel_driver(NULL)) {
+ if (!driver_is_parallel) {
nerrors += test_obj_ref(fapl);
nerrors += test_reg_ref(fapl);
}
diff --git a/test/h5test.c b/test/h5test.c
index 8ec6047..31d85b1 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -1280,6 +1280,22 @@ h5_get_file_size(const char *filename, hid_t fapl)
/* Return total size */
return (tot_size);
} /* end if */
+ else if (driver == H5FD_SUBFILING) {
+ hsize_t size;
+ hid_t fid = H5I_INVALID_HID;
+
+ if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
+ return -1;
+ if (H5Fget_filesize(fid, &size) < 0) {
+ H5Fclose(fid);
+ return -1;
+ }
+
+ if (H5Fclose(fid) < 0)
+ return -1;
+
+ return (h5_stat_size_t)size;
+ }
else {
/* Get the file's statistics */
if (0 == HDstat(filename, &sb))
@@ -2209,9 +2225,8 @@ h5_using_default_driver(const char *drv_name)
/*-------------------------------------------------------------------------
* 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).
+ * Purpose: Checks if the current VFD set on the given FAPL is a
+ * parallel-enabled VFD (The MPI I/O VFD, for example).
*
* This is mostly useful for avoiding tests that use features
* which are not currently supported for parallel HDF5, such
@@ -2221,51 +2236,72 @@ h5_using_default_driver(const char *drv_name)
*
*-------------------------------------------------------------------------
*/
-hbool_t
-h5_using_parallel_driver(const char *drv_name)
+herr_t
+h5_using_parallel_driver(hid_t fapl_id, hbool_t *driver_is_parallel)
{
- hbool_t ret_val = FALSE;
+ unsigned long feat_flags = 0;
+ hid_t driver_id = H5I_INVALID_HID;
+ herr_t ret_value = SUCCEED;
- if (!drv_name)
- drv_name = HDgetenv(HDF5_DRIVER);
+ HDassert(fapl_id >= 0);
+ HDassert(driver_is_parallel);
- if (drv_name)
- return (!HDstrcmp(drv_name, "mpio"));
+ if (fapl_id == H5P_DEFAULT)
+ fapl_id = H5P_FILE_ACCESS_DEFAULT;
- return ret_val;
+ if ((driver_id = H5Pget_driver(fapl_id)) < 0)
+ return FAIL;
+
+ if (H5FDdriver_query(driver_id, &feat_flags) < 0)
+ return FAIL;
+
+ *driver_is_parallel = (feat_flags & H5FD_FEAT_HAS_MPI);
+
+ return ret_value;
}
/*-------------------------------------------------------------------------
- * Function: h5_driver_uses_modified_filename
+ * Function: h5_driver_is_default_vfd_compatible
*
- * 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.
+ * Purpose: Checks if the current VFD set on the given FAPL creates a
+ * file that is compatible with the default VFD. Some examples
+ * are the core and MPI I/O drivers. Some counterexamples are
+ * the multi and family drivers, which split the HDF5 file
+ * into several different files.
*
* 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.
+ * pre-generated files. VFDs that create files which aren't
+ * compatible with the default VFD will generally not be able
+ * to open these pre-generated files and those particular
+ * tests will fail.
*
- * Return: TRUE/FALSE
+ * Return: Non-negative on success/Negative on failure
*
*-------------------------------------------------------------------------
*/
-hbool_t
-h5_driver_uses_modified_filename(void)
+herr_t
+h5_driver_is_default_vfd_compatible(hid_t fapl_id, hbool_t *default_vfd_compatible)
{
- hbool_t ret_val = FALSE;
- char * driver = HDgetenv(HDF5_DRIVER);
+ unsigned long feat_flags = 0;
+ hid_t driver_id = H5I_INVALID_HID;
+ herr_t ret_value = SUCCEED;
- if (driver) {
- ret_val = !HDstrcmp(driver, "multi") || !HDstrcmp(driver, "split") || !HDstrcmp(driver, "family") ||
- !HDstrcmp(driver, "splitter");
- }
+ HDassert(fapl_id >= 0);
+ HDassert(default_vfd_compatible);
- return ret_val;
-} /* end h5_driver_uses_modified_filename() */
+ if (fapl_id == H5P_DEFAULT)
+ fapl_id = H5P_FILE_ACCESS_DEFAULT;
+
+ if ((driver_id = H5Pget_driver(fapl_id)) < 0)
+ return FAIL;
+
+ if (H5FDdriver_query(driver_id, &feat_flags) < 0)
+ return FAIL;
+
+ *default_vfd_compatible = (feat_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE);
+
+ return ret_value;
+} /* end h5_driver_is_default_vfd_compatible() */
/*-------------------------------------------------------------------------
* Function: h5_driver_uses_multiple_files
@@ -2286,6 +2322,9 @@ h5_driver_uses_modified_filename(void)
* separate logical files. The splitter driver is an example
* of this type of driver.
*
+ * Eventually, this should become a VFD feature flag so this
+ * check is less fragile.
+ *
* Return: TRUE/FALSE
*
*-------------------------------------------------------------------------
@@ -2300,7 +2339,8 @@ h5_driver_uses_multiple_files(const char *drv_name, unsigned flags)
if (drv_name) {
if ((flags & H5_EXCLUDE_MULTIPART_DRIVERS) == 0) {
- if (!HDstrcmp(drv_name, "split") || !HDstrcmp(drv_name, "multi") || !HDstrcmp(drv_name, "family"))
+ if (!HDstrcmp(drv_name, "split") || !HDstrcmp(drv_name, "multi") ||
+ !HDstrcmp(drv_name, "family") || !HDstrcmp(drv_name, H5FD_SUBFILING_NAME))
return TRUE;
}
diff --git a/test/h5test.h b/test/h5test.h
index 052f6b5..3d18a2b 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -230,8 +230,8 @@ 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 herr_t h5_using_parallel_driver(hid_t fapl_id, hbool_t *driver_is_parallel);
+H5TEST_DLL herr_t h5_driver_is_default_vfd_compatible(hid_t fapl_id, hbool_t *default_vfd_compatible);
H5TEST_DLL hbool_t h5_driver_uses_multiple_files(const char *drv_name, unsigned flags);
/* Functions that will replace components of a FAPL */
diff --git a/test/lheap.c b/test/lheap.c
index c9c6ca9..a6821db 100644
--- a/test/lheap.c
+++ b/test/lheap.c
@@ -59,6 +59,7 @@ main(void)
char buf[1024]; /* the value to store */
const char *s; /* value to read */
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
+ hbool_t driver_is_default_compatible;
/* Reset library */
h5_reset();
@@ -174,7 +175,10 @@ main(void)
goto error;
PASSED();
- if (!h5_driver_uses_modified_filename()) {
+ if (h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible) < 0)
+ TEST_ERROR;
+
+ if (driver_is_default_compatible) {
/* Check opening existing file non-default sizes of lengths and addresses */
TESTING("opening pre-created file with non-default sizes");
{
diff --git a/test/links.c b/test/links.c
index b87b998..dbfd1ef 100644
--- a/test/links.c
+++ b/test/links.c
@@ -9896,11 +9896,12 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format)
/* Family file driver cannot be used with family or multi drivers for member files */
/* Also disable parallel member drivers, because H5F_HAS_FEATURE(H5FD_FEAT_HAS_MPI)
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_DIRECT)
- ? H5P_DEFAULT
- : fapl;
+ 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_DIRECT || base_driver == H5FD_SUBFILING)
+ ? H5P_DEFAULT
+ : fapl;
op_data.fam_size = ELINK_CB_FAM_SIZE;
op_data.code = 0;
@@ -22554,7 +22555,7 @@ 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();
+ hbool_t driver_is_default_compatible;
env_h5_drvr = HDgetenv(HDF5_DRIVER);
if (env_h5_drvr == NULL)
@@ -22563,6 +22564,9 @@ main(void)
h5_reset();
fapl = h5_fileaccess();
+ if (h5_driver_is_default_vfd_compatible(fapl, &driver_is_default_compatible) < 0)
+ TEST_ERROR;
+
/* fapl2 uses "latest version bounds" */
if ((fapl2 = H5Pcopy(fapl)) < 0)
TEST_ERROR;
@@ -22676,7 +22680,7 @@ main(void)
nerrors += external_link_closing_deprec(my_fapl, new_format) < 0 ? 1 : 0;
#endif /* H5_NO_DEPRECATED_SYMBOLS */
- if (!driver_uses_modified_filename) {
+ if (driver_is_default_compatible) {
nerrors += external_link_endian(new_format) < 0 ? 1 : 0;
}
@@ -22691,7 +22695,7 @@ main(void)
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) {
+ if (driver_is_default_compatible) {
nerrors += external_set_elink_fapl1(my_fapl, new_format) < 0 ? 1 : 0;
}
diff --git a/test/mf.c b/test/mf.c
index bed92e3..04ef59a 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -875,8 +875,7 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
TESTING("'temporary' file space allocation with old library format");
/* Can't run this test with multi-file VFDs */
- if (HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
- HDstrcmp(env_h5_drvr, "family") != 0) {
+ if (!h5_driver_uses_multiple_files(env_h5_drvr, 0)) {
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t * f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size, new_file_size; /* file size */
diff --git a/test/mtime.c b/test/mtime.c
index a7e01c2..0d56d15 100644
--- a/test/mtime.c
+++ b/test/mtime.c
@@ -60,13 +60,16 @@ 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();
+ hbool_t driver_is_default_compatible;
h5_reset();
fapl = h5_fileaccess();
TESTING("modification time messages");
+ if (h5_driver_is_default_vfd_compatible(fapl, &driver_is_default_compatible) < 0)
+ TEST_ERROR;
+
/* Create the file, create a dataset, then close the file */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
@@ -132,7 +135,7 @@ main(void)
}
PASSED();
- if (!driver_uses_modified_filename) {
+ if (driver_is_default_compatible) {
/* Check opening existing file with old-style modification time information
* and make certain that the time is correct
*/
@@ -164,7 +167,7 @@ main(void)
PASSED();
}
- if (!driver_uses_modified_filename) {
+ if (driver_is_default_compatible) {
/* Check opening existing file with new-style modification time information
* and make certain that the time is correct
*/
diff --git a/test/ntypes.c b/test/ntypes.c
index 318fe2f..4a42f16 100644
--- a/test/ntypes.c
+++ b/test/ntypes.c
@@ -3153,9 +3153,10 @@ error:
int
main(void)
{
- hid_t file, fapl;
- int nerrors = 0;
- char filename[1024];
+ hid_t file, fapl;
+ int nerrors = 0;
+ char filename[1024];
+ hbool_t driver_is_parallel;
h5_reset();
fapl = h5_fileaccess();
@@ -3164,6 +3165,9 @@ main(void)
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
+ if (h5_using_parallel_driver(fapl, &driver_is_parallel) < 0)
+ goto error;
+
nerrors += test_atomic_dtype(file) < 0 ? 1 : 0;
nerrors += test_compound_dtype(file) < 0 ? 1 : 0;
nerrors += test_compound_dtype2(file) < 0 ? 1 : 0;
@@ -3173,14 +3177,14 @@ main(void)
nerrors += test_array_dtype(file) < 0 ? 1 : 0;
nerrors += test_array_dtype2(file) < 0 ? 1 : 0;
- if (!h5_using_parallel_driver(NULL)) {
+ if (!driver_is_parallel) {
nerrors += test_vl_dtype(file) < 0 ? 1 : 0;
nerrors += test_vlstr_dtype(file) < 0 ? 1 : 0;
}
nerrors += test_str_dtype(file) < 0 ? 1 : 0;
- if (!h5_using_parallel_driver(NULL)) {
+ if (!driver_is_parallel) {
nerrors += test_refer_dtype(file) < 0 ? 1 : 0;
nerrors += test_refer_dtype2(file) < 0 ? 1 : 0;
}
diff --git a/test/objcopy.c b/test/objcopy.c
index 62fb22e..3f8f70a 100644
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -17313,6 +17313,7 @@ main(void)
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 */
+ hbool_t driver_is_default_compatible;
env_h5_drvr = HDgetenv(HDF5_DRIVER);
if (env_h5_drvr == NULL)
@@ -17322,6 +17323,9 @@ main(void)
h5_reset();
fapl = h5_fileaccess();
+ if (h5_driver_is_default_vfd_compatible(fapl, &driver_is_default_compatible) < 0)
+ TEST_ERROR;
+
ExpressMode = GetTestExpress();
if (ExpressMode > 1)
HDprintf("***Express test mode on. Some tests may be skipped\n");
@@ -17558,10 +17562,7 @@ main(void)
nerrors += test_copy_same_file_named_datatype(fcpl_src, src_fapl);
- /* 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()) {
+ if (driver_is_default_compatible) {
/* 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);
diff --git a/test/set_extent.c b/test/set_extent.c
index bba57fa..61290a3 100644
--- a/test/set_extent.c
+++ b/test/set_extent.c
@@ -230,9 +230,13 @@ do_ranks(hid_t fapl, hbool_t new_format)
hid_t dcpl = -1;
int fillvalue = FILL_VALUE;
unsigned config;
+ hbool_t driver_is_parallel;
TESTING_2("datasets with ranks 1 to 4 (all configurations)");
+ if (h5_using_parallel_driver(fapl, &driver_is_parallel) < 0)
+ TEST_ERROR;
+
/* Loop over different configurations for tests */
for (config = 0; config <= CONFIG_ALL; config++) {
/* Create DCPL and add appropriate settings */
@@ -343,7 +347,7 @@ do_ranks(hid_t fapl, hbool_t new_format)
goto error;
} /* end if */
- if (!h5_using_parallel_driver(NULL)) {
+ if (!driver_is_parallel) {
/* VL test */
if (test_random_rank4_vl(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE, index_type) <
0) {
@@ -367,7 +371,7 @@ do_ranks(hid_t fapl, hbool_t new_format)
goto error;
} /* end if */
- if (!h5_using_parallel_driver(NULL)) {
+ if (!driver_is_parallel) {
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")
diff --git a/test/stab.c b/test/stab.c
index b4c92a4..255ad39 100644
--- a/test/stab.c
+++ b/test/stab.c
@@ -1418,8 +1418,8 @@ main(void)
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 contiguous address space */
- hbool_t driver_uses_modified_filename = h5_driver_uses_modified_filename();
- int nerrors = 0;
+ hbool_t driver_is_default_compatible;
+ int nerrors = 0;
/* Get the VFD to use */
env_h5_drvr = HDgetenv(HDF5_DRIVER);
@@ -1433,6 +1433,9 @@ main(void)
h5_reset();
fapl = h5_fileaccess();
+ if (h5_driver_is_default_vfd_compatible(fapl, &driver_is_default_compatible) < 0)
+ TEST_ERROR;
+
/* Copy the file access property list */
if ((fapl2 = H5Pcopy(fapl)) < 0)
TEST_ERROR;
@@ -1476,7 +1479,7 @@ main(void)
nerrors += lifecycle(fcpl2, fapl2);
nerrors += long_compact(fcpl2, fapl2);
- if (!driver_uses_modified_filename) {
+ if (driver_is_default_compatible) {
nerrors += read_old();
}
@@ -1487,7 +1490,7 @@ main(void)
/* Old group API specific tests */
nerrors += old_api(fapl);
- if (!driver_uses_modified_filename) {
+ if (driver_is_default_compatible) {
nerrors += corrupt_stab_msg();
}
diff --git a/test/tarray.c b/test/tarray.c
index 3b17239..4669fc7 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -1919,7 +1919,8 @@ test_compat(void)
size_t off; /* Offset of compound field */
hid_t mtid; /* Datatype ID for field */
int i; /* Index variables */
- herr_t ret; /* Generic return value */
+ hbool_t driver_is_default_compatible;
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Array Datatypes Compatibility Functionality\n"));
@@ -1934,6 +1935,13 @@ test_compat(void)
* the tarrold.h5 file.
*/
+ if (h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible) < 0)
+ TestErrPrintf("can't check if VFD is default VFD compatible\n");
+ if (!driver_is_default_compatible) {
+ HDprintf(" -- SKIPPED --\n");
+ return;
+ }
+
/* Open the testfile */
fid1 = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK_I(fid1, "H5Fopen");
@@ -2217,10 +2225,8 @@ test_array(void)
test_array_bkg(); /* Read compound datatype with array fields and background fields read */
- if (!h5_driver_uses_modified_filename()) {
- /* This test uses a custom file */
- test_compat(); /* Test compatibility changes for compound datatype fields */
- }
+ /* This test uses a custom file */
+ test_compat(); /* Test compatibility changes for compound datatype fields */
} /* end test_array() */
diff --git a/test/tfile.c b/test/tfile.c
index caf9c62..3babae5 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -1647,7 +1647,8 @@ test_file_is_accessible(const char *env_h5_drvr)
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 */
+ hbool_t driver_is_default_compatible;
+ herr_t ret; /* Return value from HDF5 calls */
/* Output message about test being performed */
MESSAGE(5, ("Testing Detection of HDF5 Files\n"));
@@ -1656,6 +1657,11 @@ test_file_is_accessible(const char *env_h5_drvr)
fapl_id = h5_fileaccess();
CHECK(fapl_id, H5I_INVALID_HID, "H5Pcreate");
+ if (h5_driver_is_default_vfd_compatible(fapl_id, &driver_is_default_compatible) < 0) {
+ TestErrPrintf("Can't check if VFD is compatible with default VFD");
+ return;
+ }
+
/* Fix up filenames */
h5_fixname(FILE_IS_ACCESSIBLE, fapl_id, filename, sizeof(filename));
h5_fixname(FILE_IS_ACCESSIBLE_NON_HDF5, fapl_id, non_hdf5_filename, sizeof(non_hdf5_filename));
@@ -1733,10 +1739,7 @@ test_file_is_accessible(const char *env_h5_drvr)
VERIFY(is_hdf5, TRUE, "H5Fis_accessible");
} /* end if */
- /* 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)) {
+ if (driver_is_default_compatible) {
/***********************/
/* EMPTY non-HDF5 file */
/***********************/
@@ -5536,10 +5539,19 @@ test_libver_bounds_copy(void)
hid_t fapl = -1; /* File access property list ID */
const char *src_fname; /* Source file name */
herr_t ret; /* Generic return value */
+ hbool_t driver_is_default_compatible;
/* Output message about the test being performed */
MESSAGE(5, ("Testing H5Ocopy a dataset in a 1.8 library file to a 1.10 library file\n"));
+ ret = h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible);
+ CHECK_I(ret, "h5_driver_is_default_vfd_compatible");
+
+ if (!driver_is_default_compatible) {
+ HDprintf("-- SKIPPED --\n");
+ return;
+ }
+
/* Get the test file name */
src_fname = H5_get_srcdir_filename(SRC_FILE);
@@ -5598,10 +5610,7 @@ 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();
-
- if (!h5_driver_uses_modified_filename()) {
- test_libver_bounds_copy();
- }
+ test_libver_bounds_copy();
} /* end test_libver_bounds() */
/**************************************************************************************
@@ -6491,30 +6500,35 @@ test_libver_bounds_dataset(hid_t fapl)
dset = (H5D_t *)H5VL_object(did);
CHECK_PTR(dset, "H5VL_object");
- /* Verify the dataset's layout, fill value and filter pipeline message versions */
- /* Also verify the chunk indexing type */
- if (f->shared->low_bound == H5F_LIBVER_EARLIEST) {
- /* For layout message: the earliest version the library will set is 3 */
- /* For fill value message: the earliest version the library will set is 2 */
- VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "H5O_layout_ver_bounds");
- VERIFY(dset->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "H5O_fill_ver_bounds");
- }
- else {
- VERIFY(dset->shared->layout.version, H5O_layout_ver_bounds[f->shared->low_bound],
- "H5O_layout_ver_bounds");
- VERIFY(dset->shared->dcpl_cache.fill.version, H5O_fill_ver_bounds[f->shared->low_bound],
- "H5O_fill_ver_bounds");
- }
+ if (dset) {
+ /* Verify the dataset's layout, fill value and filter pipeline message versions */
+ /* Also verify the chunk indexing type */
+ if (f->shared->low_bound == H5F_LIBVER_EARLIEST) {
+ /* For layout message: the earliest version the library will set is 3 */
+ /* For fill value message: the earliest version the library will set is 2 */
+ VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT,
+ "H5O_layout_ver_bounds");
+ VERIFY(dset->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2,
+ "H5O_fill_ver_bounds");
+ }
+ else {
+ VERIFY(dset->shared->layout.version, H5O_layout_ver_bounds[f->shared->low_bound],
+ "H5O_layout_ver_bounds");
+ VERIFY(dset->shared->dcpl_cache.fill.version,
+ H5O_fill_ver_bounds[f->shared->low_bound], "H5O_fill_ver_bounds");
+ }
- /* Verify the filter pipeline message version */
- VERIFY(dset->shared->dcpl_cache.pline.version, H5O_pline_ver_bounds[f->shared->low_bound],
- "H5O_pline_ver_bounds");
+ /* Verify the filter pipeline message version */
+ VERIFY(dset->shared->dcpl_cache.pline.version, H5O_pline_ver_bounds[f->shared->low_bound],
+ "H5O_pline_ver_bounds");
- /* Verify the dataset's chunk indexing type */
- if (dset->shared->layout.version == H5O_LAYOUT_VERSION_LATEST)
- VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BT2, "chunk_index_type");
- else
- VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BTREE, "chunk_index_type");
+ /* Verify the dataset's chunk indexing type */
+ if (dset->shared->layout.version == H5O_LAYOUT_VERSION_LATEST)
+ VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BT2, "chunk_index_type");
+ else
+ VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BTREE,
+ "chunk_index_type");
+ }
/* Close the dataset */
ret = H5Dclose(did);
@@ -6739,13 +6753,19 @@ test_libver_bounds_dataspace(hid_t fapl)
tmp_space_contig = (H5S_t *)H5I_object(tmp_sid_contig);
CHECK_PTR(tmp_space_contig, "H5I_object");
- /* Verify versions for the three dataspaces */
- VERIFY(tmp_space->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound],
- "H5O_sdspace_ver_bounds");
- VERIFY(tmp_space_compact->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound],
- "H5O_sdspace_ver_bounds");
- VERIFY(tmp_space_contig->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound],
- "H5O_sdspace_ver_bounds");
+ if (tmp_space) {
+ /* Verify versions for the three dataspaces */
+ VERIFY(tmp_space->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound],
+ "H5O_sdspace_ver_bounds");
+ }
+ if (tmp_space_compact) {
+ VERIFY(tmp_space_compact->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound],
+ "H5O_sdspace_ver_bounds");
+ }
+ if (tmp_space_contig) {
+ VERIFY(tmp_space_contig->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound],
+ "H5O_sdspace_ver_bounds");
+ }
/* Close the three datasets */
ret = H5Dclose(did);
@@ -7063,24 +7083,26 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid)
dtype = (H5T_t *)H5I_object(dtid);
CHECK_PTR(dtype, "H5I_object");
- /* Verify the dataset's datatype message version */
- /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY:
- * --the library will set version according to low_bound
- * --H5T_ARRAY: the earliest version the library will set is 2
- * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE:
- * --the library will only use basic version
- */
- if (dtype->shared->type == H5T_COMPOUND || dtype->shared->type == H5T_ENUM ||
- dtype->shared->type == H5T_ARRAY) {
- if (dtype->shared->type == H5T_ARRAY && f->shared->low_bound == H5F_LIBVER_EARLIEST)
- VERIFY(dtype->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds");
+ if (dtype) {
+ /* Verify the dataset's datatype message version */
+ /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY:
+ * --the library will set version according to low_bound
+ * --H5T_ARRAY: the earliest version the library will set is 2
+ * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE:
+ * --the library will only use basic version
+ */
+ if (dtype->shared->type == H5T_COMPOUND || dtype->shared->type == H5T_ENUM ||
+ dtype->shared->type == H5T_ARRAY) {
+ if (dtype->shared->type == H5T_ARRAY && f->shared->low_bound == H5F_LIBVER_EARLIEST)
+ VERIFY(dtype->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds");
+ else
+ VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[f->shared->low_bound],
+ "H5O_dtype_ver_bounds");
+ }
else
- VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[f->shared->low_bound],
+ VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST],
"H5O_dtype_ver_bounds");
}
- else
- VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST],
- "H5O_dtype_ver_bounds");
/* Close the dataset */
ret = H5Dclose(did);
@@ -8017,9 +8039,9 @@ test_deprec(const char *env_h5_drvr)
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 */
- hbool_t driver_uses_modified_filename = h5_driver_uses_modified_filename();
+ const char *env_h5_drvr; /* File Driver value from environment */
+ hid_t fapl_id = H5I_INVALID_HID; /* VFD-dependent fapl ID */
+ hbool_t driver_is_default_compatible;
herr_t ret;
/* Output message about test being performed */
@@ -8034,6 +8056,9 @@ test_file(void)
fapl_id = h5_fileaccess();
CHECK(fapl_id, H5I_INVALID_HID, "h5_fileaccess");
+ ret = h5_driver_is_default_vfd_compatible(fapl_id, &driver_is_default_compatible);
+ CHECK(ret, FAIL, "h5_driver_is_default_vfd_compatible");
+
test_file_create(); /* Test file creation(also creation templates)*/
test_file_open(env_h5_drvr); /* Test file opening */
test_file_reopen(); /* Test file reopening */
@@ -8057,7 +8082,7 @@ test_file(void)
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) {
+ if (driver_is_default_compatible) {
test_rw_noupdate(); /* Test to ensure that RW permissions don't write the file unless dirtied */
}
@@ -8078,7 +8103,7 @@ test_file(void)
test_sects_freespace(env_h5_drvr, FALSE); /* Test file public routine H5Fget_free_sections() */
/* Skipped testing for multi/split drivers */
- if (!driver_uses_modified_filename) {
+ if (driver_is_default_compatible) {
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
diff --git a/test/th5s.c b/test/th5s.c
index 1bc19d4..ac82646 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -125,7 +125,8 @@ test_h5s_basic(void)
hsize_t max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3, SPACE2_MAX4};
hsize_t tdims[4]; /* Dimension array to test with */
hsize_t tmax[4];
- hssize_t n; /* Number of dataspace elements */
+ hssize_t n; /* Number of dataspace elements */
+ hbool_t driver_is_default_compatible;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -194,7 +195,10 @@ 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()) {
+ ret = h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible);
+ CHECK_I(ret, "h5_driver_is_default_vfd_compatible");
+
+ if (driver_is_default_compatible) {
const char *testfile = H5_get_srcdir_filename(TESTFILE); /* Corrected test file name */
fid1 = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
diff --git a/test/titerate.c b/test/titerate.c
index 5796f11..d870750 100644
--- a/test/titerate.c
+++ b/test/titerate.c
@@ -1009,6 +1009,7 @@ test_corrupted_attnamelen(void)
searched_err_t err_caught; /* Data to be passed to callback func */
int err_status; /* Status returned by H5Aiterate2 */
herr_t ret; /* Return value */
+ hbool_t driver_is_default_compatible;
const char * testfile = H5_get_srcdir_filename(CORRUPTED_ATNAMELEN_FILE); /* Corrected test file name */
const char *err_message = "attribute name has different length than stored length";
@@ -1017,6 +1018,14 @@ test_corrupted_attnamelen(void)
/* Output message about test being performed */
MESSAGE(5, ("Testing the Handling of Corrupted Attribute's Name Length\n"));
+ ret = h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible);
+ CHECK(ret, FAIL, "h5_driver_is_default_vfd_compatible");
+
+ if (!driver_is_default_compatible) {
+ HDprintf("-- SKIPPED --\n");
+ return;
+ }
+
fid = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
@@ -1175,10 +1184,8 @@ test_iterate(void)
#endif
} /* end for */
- if (!h5_driver_uses_modified_filename()) {
- /* Test the fix for issue HDFFV-10588 */
- test_corrupted_attnamelen();
- }
+ /* 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 f8bf602..9fa8f2f 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -190,7 +190,8 @@ typedef struct {
#define MISC14_METADATA_SIZE 4096
/* Definitions for misc. test #15 */
-#define MISC15_FILE "tmisc15.h5"
+#define MISC15_FILE "tmisc15.h5"
+#define MISC15_BUF_SIZE 1024
/* Definitions for misc. test #16 */
#define MISC16_FILE "tmisc16.h5"
@@ -1783,11 +1784,20 @@ test_misc10(void)
hid_t dcpl; /* Dataset creation property list */
hid_t space, type; /* Old dataset's dataspace & datatype */
const char *testfile = H5_get_srcdir_filename(MISC10_FILE_OLD); /* Corrected test file name */
+ hbool_t driver_is_default_compatible;
herr_t ret;
/* Output message about test being performed */
MESSAGE(5, ("Testing using old dataset creation property list\n"));
+ ret = h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible);
+ CHECK(ret, FAIL, "h5_driver_is_default_vfd_compatible");
+
+ if (!driver_is_default_compatible) {
+ HDprintf("-- SKIPPED --\n");
+ return;
+ }
+
/*
* Open the old file and the dataset and get old settings.
*/
@@ -2736,14 +2746,21 @@ test_misc14(void)
static void
test_misc15(void)
{
+ char filename[MISC15_BUF_SIZE];
hid_t file; /* File ID */
hid_t fapl; /* File access property list */
herr_t ret; /* Generic return value */
+ fapl = h5_fileaccess();
+ h5_fixname(MISC15_FILE, fapl, filename, MISC15_BUF_SIZE);
+
/* Create the file & get it's FAPL */
- file = H5Fcreate(MISC15_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
CHECK(file, FAIL, "H5Fcreate");
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
fapl = H5Fget_access_plist(file);
CHECK(fapl, FAIL, "H5Fget_access_plist");
@@ -2754,7 +2771,7 @@ test_misc15(void)
CHECK(ret, FAIL, "H5Fclose");
/* Open the file & get it's FAPL again */
- file = H5Fopen(MISC15_FILE, H5F_ACC_RDONLY, H5P_DEFAULT);
+ file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fopen");
fapl = H5Fget_access_plist(file);
@@ -2764,13 +2781,13 @@ test_misc15(void)
CHECK(ret, FAIL, "H5Fclose");
/* Verify that the file is still OK */
- ret = H5Fis_accessible(MISC15_FILE, fapl);
- CHECK(ret, FAIL, "H5Fis_hdf5");
+ ret = H5Fis_accessible(filename, fapl);
+ CHECK(ret, FAIL, "H5Fis_accessible");
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- file = H5Fopen(MISC15_FILE, H5F_ACC_RDONLY, H5P_DEFAULT);
+ file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fopen");
ret = H5Fclose(file);
@@ -3670,11 +3687,20 @@ test_misc20(void)
unsigned version; /* Version of storage layout info */
hsize_t contig_size; /* Size of contiguous storage size from layout into */
const char *testfile = H5_get_srcdir_filename(MISC20_FILE_OLD); /* Corrected test file name */
- herr_t ret; /* Generic return value */
+ hbool_t driver_is_default_compatible;
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing large dimension truncation fix\n"));
+ ret = h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible);
+ CHECK(ret, FAIL, "h5_driver_is_default_vfd_compatible");
+
+ if (!driver_is_default_compatible) {
+ HDprintf("-- SKIPPED --\n");
+ return;
+ }
+
/* Verify that chunks with dimensions that are too large get rejected */
/* Create a dataset creation property list */
@@ -4957,11 +4983,20 @@ test_misc25b(void)
hid_t fid; /* File ID */
hid_t gid; /* Group ID */
const char *testfile = H5_get_srcdir_filename(MISC25B_FILE); /* Corrected test file name */
- herr_t ret; /* Generic return value */
+ hbool_t driver_is_default_compatible;
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Exercise null object header message bug\n"));
+ ret = h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible);
+ CHECK(ret, FAIL, "h5_driver_is_default_vfd_compatible");
+
+ if (!driver_is_default_compatible) {
+ HDprintf("-- SKIPPED --\n");
+ return;
+ }
+
/* Open file */
fid = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
@@ -5209,11 +5244,20 @@ test_misc27(void)
hid_t fid; /* File ID */
hid_t gid; /* Group ID */
const char *testfile = H5_get_srcdir_filename(MISC27_FILE); /* Corrected test file name */
- herr_t ret; /* Generic return value */
+ hbool_t driver_is_default_compatible;
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Corrupt object header handling\n"));
+ ret = h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible);
+ CHECK(ret, FAIL, "h5_driver_is_default_vfd_compatible");
+
+ if (!driver_is_default_compatible) {
+ HDprintf("-- SKIPPED --\n");
+ return;
+ }
+
/* Open the file */
fid = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
@@ -5423,12 +5467,21 @@ test_misc28(void)
static void
test_misc29(void)
{
- hid_t fid; /* File ID */
- herr_t ret; /* Generic return value */
+ hbool_t driver_is_default_compatible;
+ hid_t fid; /* File ID */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Speculative metadata reads\n"));
+ ret = h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible);
+ CHECK(ret, FAIL, "h5_driver_is_default_vfd_compatible");
+
+ if (!driver_is_default_compatible) {
+ HDprintf("-- SKIPPED --\n");
+ return;
+ }
+
/* Make a copy of the data file from svn. */
ret = h5_make_local_copy(MISC29_ORIG_FILE, MISC29_COPY_FILE);
CHECK(ret, -1, "h5_make_local_copy");
@@ -5706,11 +5759,20 @@ test_misc33(void)
hid_t fid = -1; /* File ID */
const char *testfile = H5_get_srcdir_filename(MISC33_FILE); /* Corrected test file name */
H5O_info2_t oinfo; /* Structure for object metadata information */
- herr_t ret; /* Generic return value */
+ hbool_t driver_is_default_compatible;
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing that bad offset into the heap returns error"));
+ ret = h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible);
+ CHECK(ret, FAIL, "h5_driver_is_default_vfd_compatible");
+
+ if (!driver_is_default_compatible) {
+ HDprintf("-- SKIPPED --\n");
+ return;
+ }
+
/* Open the test file */
fid = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
@@ -6026,25 +6088,21 @@ 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);
+ 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 */
-
- if (!driver_uses_modified_filename) {
- test_misc10(); /* Test for using dataset creation property lists from old files */
- }
+ 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 */
if (default_driver) {
test_misc11(); /* Test for all properties of a file creation property list being stored */
@@ -6057,19 +6115,12 @@ test_misc(void)
}
test_misc14(); /* Test that deleted dataset's data is removed from sieve buffer correctly */
-
- if (!driver_uses_modified_filename) {
- test_misc15(); /* Test that checking a file's access property list more than once works */
- }
-
+ 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 */
-
- if (!driver_uses_modified_filename) {
- test_misc20(); /* Test problems with truncated dimensions in version 2 of storage layout message */
- }
+ 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
@@ -6079,36 +6130,20 @@ 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 */
-
- if (!driver_uses_modified_filename) {
- test_misc25b(); /* Exercise null object header message merge bug on existing file */
- }
-
+ 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 */
-
- 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 */
+ 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 */
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_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 */
diff --git a/test/tsohm.c b/test/tsohm.c
index 6b2b270..cf813a8 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -3293,11 +3293,20 @@ verify_dset_create_and_open_through_extlink_with_sohm(hid_t src_fcpl_id, hid_t d
static void
test_sohm_extlink(void)
{
- hid_t fcpl_id = -1;
- herr_t ret;
+ hid_t fcpl_id = -1;
+ hbool_t driver_is_default_compatible;
+ herr_t ret;
MESSAGE(5, ("Testing SOHM creation through external links\n"));
+ ret = h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible);
+ CHECK_I(ret, "h5_driver_is_default_vfd_compatible");
+
+ if (!driver_is_default_compatible) {
+ HDprintf("-- SKIPPED --\n");
+ return;
+ }
+
fcpl_id = H5Pcreate(H5P_FILE_CREATE);
CHECK_I(fcpl_id, "H5Pcreate");
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 1);
@@ -3851,9 +3860,7 @@ test_sohm(void)
test_sohm_delete_revert(); /* Test that a file with SOHMs becomes an
* empty file again when they are deleted. */
- if (!h5_driver_uses_modified_filename()) {
- test_sohm_extlink(); /* Test SOHMs when external links are used */
- }
+ 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/vds.c b/test/vds.c
index f6b1794..3da8ce2 100644
--- a/test/vds.c
+++ b/test/vds.c
@@ -12305,26 +12305,30 @@ main(void)
unsigned bit_config;
H5F_libver_t low, high; /* Low and high bounds */
const char * env_h5_drvr; /* File Driver value from environment */
+ hbool_t driver_is_parallel;
int nerrors = 0;
env_h5_drvr = HDgetenv(HDF5_DRIVER);
if (env_h5_drvr == NULL)
env_h5_drvr = "nomatch";
+ /* Testing setup */
+ h5_reset();
+ fapl = h5_fileaccess();
+
+ if (h5_using_parallel_driver(fapl, &driver_is_parallel) < 0)
+ TEST_ERROR;
+
/*
* 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")) {
+ if (driver_is_parallel || !HDstrcmp(env_h5_drvr, "splitter")) {
HDputs(" -- SKIPPED for incompatible VFD --");
HDexit(EXIT_SUCCESS);
}
- /* Testing setup */
- h5_reset();
- fapl = h5_fileaccess();
-
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
/* Create FAPLs for VDS and source files */
diff --git a/test/vds_env.c b/test/vds_env.c
index c80384b..fb4a300 100644
--- a/test/vds_env.c
+++ b/test/vds_env.c
@@ -327,26 +327,30 @@ main(void)
unsigned bit_config;
H5F_libver_t low, high; /* Low and high bounds */
const char * env_h5_drvr; /* File Driver value from environment */
+ hbool_t driver_is_parallel;
int nerrors = 0;
env_h5_drvr = HDgetenv(HDF5_DRIVER);
if (env_h5_drvr == NULL)
env_h5_drvr = "nomatch";
+ /* Testing setup */
+ h5_reset();
+ fapl = h5_fileaccess();
+
+ if (h5_using_parallel_driver(fapl, &driver_is_parallel) < 0)
+ TEST_ERROR;
+
/*
* 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")) {
+ if (driver_is_parallel || !HDstrcmp(env_h5_drvr, "splitter")) {
HDputs(" -- SKIPPED for incompatible VFD --");
HDexit(EXIT_SUCCESS);
}
- /* Testing setup */
- h5_reset();
- fapl = h5_fileaccess();
-
/* Set to use the latest file format */
if ((my_fapl = H5Pcopy(fapl)) < 0)
TEST_ERROR;
diff --git a/test/vol.c b/test/vol.c
index 52758f3..a738063 100644
--- a/test/vol.c
+++ b/test/vol.c
@@ -948,7 +948,7 @@ error:
*-------------------------------------------------------------------------
*/
static herr_t
-test_basic_group_operation(const char *env_h5_drvr)
+test_basic_group_operation(void)
{
hid_t fid = H5I_INVALID_HID;
hid_t fapl_id = H5I_INVALID_HID;
@@ -957,6 +957,7 @@ test_basic_group_operation(const char *env_h5_drvr)
hid_t gcpl_id = H5I_INVALID_HID;
char filename[1024];
H5G_info_t info;
+ hbool_t driver_is_parallel;
TESTING("Basic VOL group operations");
@@ -991,8 +992,10 @@ test_basic_group_operation(const char *env_h5_drvr)
if (H5Gget_info_by_idx(fid, "/", H5_INDEX_NAME, H5_ITER_NATIVE, 0, &info, H5P_DEFAULT) < 0)
TEST_ERROR;
- /* H5Gflush - skip for MPIO file driver as flush calls cause assertions in the library */
- if (HDstrcmp(env_h5_drvr, "mpio") != 0)
+ /* H5Gflush - skip for parallel file drivers as flush calls cause assertions in the library */
+ if (h5_using_parallel_driver(fapl_id, &driver_is_parallel) < 0)
+ TEST_ERROR;
+ if (!driver_is_parallel)
if (H5Gflush(gid) < 0)
TEST_ERROR;
@@ -1052,7 +1055,7 @@ error:
*-------------------------------------------------------------------------
*/
static herr_t
-test_basic_dataset_operation(const char *env_h5_drvr)
+test_basic_dataset_operation(void)
{
hid_t fid = H5I_INVALID_HID;
hid_t fapl_id = H5I_INVALID_HID;
@@ -1072,6 +1075,8 @@ test_basic_dataset_operation(const char *env_h5_drvr)
haddr_t offset;
H5D_space_status_t status;
+ hbool_t driver_is_parallel;
+
int in_buf[N_ELEMENTS];
int out_buf[N_ELEMENTS];
@@ -1117,8 +1122,10 @@ test_basic_dataset_operation(const char *env_h5_drvr)
if (H5Dset_extent(did, &curr_dims) < 0)
TEST_ERROR;
- /* H5Dflush - skip for MPIO file driver as flush calls cause assertions in the library */
- if (HDstrcmp(env_h5_drvr, "mpio") != 0)
+ /* H5Dflush - skip for parallel file drivers as flush calls cause assertions in the library */
+ if (h5_using_parallel_driver(fapl_id, &driver_is_parallel) < 0)
+ TEST_ERROR;
+ if (!driver_is_parallel)
if (H5Dflush(did) < 0)
TEST_ERROR;
@@ -1508,14 +1515,15 @@ error:
*-------------------------------------------------------------------------
*/
static herr_t
-test_basic_datatype_operation(const char *env_h5_drvr)
+test_basic_datatype_operation(void)
{
- hid_t fid = H5I_INVALID_HID;
- hid_t fapl_id = H5I_INVALID_HID;
- hid_t tid = H5I_INVALID_HID;
- hid_t tid_anon = H5I_INVALID_HID;
- hid_t tcpl_id = H5I_INVALID_HID;
- char filename[1024];
+ hid_t fid = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+ hid_t tid_anon = H5I_INVALID_HID;
+ hid_t tcpl_id = H5I_INVALID_HID;
+ char filename[1024];
+ hbool_t driver_is_parallel;
TESTING("Basic VOL datatype operations");
@@ -1532,8 +1540,10 @@ test_basic_datatype_operation(const char *env_h5_drvr)
if (H5Tcommit2(fid, NATIVE_VOL_TEST_DATATYPE_NAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- /* H5Tflush - skip for MPIO file driver as flush calls cause assertions in the library */
- if (HDstrcmp(env_h5_drvr, "mpio") != 0)
+ /* H5Tflush - skip for parallel file drivers as flush calls cause assertions in the library */
+ if (h5_using_parallel_driver(fapl_id, &driver_is_parallel) < 0)
+ TEST_ERROR;
+ if (!driver_is_parallel)
if (H5Tflush(tid) < 0)
TEST_ERROR;
@@ -2133,12 +2143,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(env_h5_drvr) < 0 ? 1 : 0;
- nerrors += test_basic_dataset_operation(env_h5_drvr) < 0 ? 1 : 0;
+ nerrors += test_basic_group_operation() < 0 ? 1 : 0;
+ nerrors += test_basic_dataset_operation() < 0 ? 1 : 0;
nerrors += test_basic_attribute_operation() < 0 ? 1 : 0;
nerrors += test_basic_object_operation() < 0 ? 1 : 0;
nerrors += test_basic_link_operation() < 0 ? 1 : 0;
- nerrors += test_basic_datatype_operation(env_h5_drvr) < 0 ? 1 : 0;
+ nerrors += test_basic_datatype_operation() < 0 ? 1 : 0;
nerrors += test_async_vol_props() < 0 ? 1 : 0;
if (nerrors) {