summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSongyu Lu <songyulu@hdfgroup.org>2019-04-04 18:16:27 (GMT)
committerSongyu Lu <songyulu@hdfgroup.org>2019-04-04 18:16:27 (GMT)
commit5e7cccb5a2813c203fc9493a2c0d42c9f666d5af (patch)
tree257600fe3193e2f324d8dd8fe193a14e23a186e8 /test
parent50d9a397ab4bcbeaa6466eabe1c2ec6e2cf61f89 (diff)
parentaa696a47715c3dd9c068f71915c6dcf23745441c (diff)
downloadhdf5-5e7cccb5a2813c203fc9493a2c0d42c9f666d5af.zip
hdf5-5e7cccb5a2813c203fc9493a2c0d42c9f666d5af.tar.gz
hdf5-5e7cccb5a2813c203fc9493a2c0d42c9f666d5af.tar.bz2
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/~songyulu/hdf5_ray into HDFFV-10658-performance-drop-from-1-8
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt7
-rw-r--r--test/CMakeVFDTests.cmake4
-rw-r--r--test/cache_tagging.c52
-rw-r--r--test/direct_chunk.c121
-rw-r--r--test/dsets.c12
-rw-r--r--test/dtypes.c24
-rw-r--r--test/h5test.c118
-rw-r--r--test/h5test.h4
-rw-r--r--test/objcopy.c6
-rw-r--r--test/ohdr.c4
-rw-r--r--test/set_extent.c4
-rw-r--r--test/testerror.sh.in4
-rw-r--r--test/tfile.c30
-rw-r--r--test/th5o.c4
-rw-r--r--test/tid.c28
-rw-r--r--test/titerate.c4
-rw-r--r--test/ttsafe_error.c65
17 files changed, 251 insertions, 240 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 276cf09..772f790 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -352,12 +352,17 @@ add_executable (ttsafe ${ttsafe_SOURCES})
target_include_directories(ttsafe PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (ttsafe STATIC)
target_link_libraries (ttsafe PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+if (NOT WIN32)
+ target_link_libraries (ttsafe
+ PRIVATE $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>
+ )
+endif ()
set_target_properties (ttsafe PROPERTIES FOLDER test)
if (BUILD_SHARED_LIBS)
add_executable (ttsafe-shared ${ttsafe_SOURCES})
target_include_directories(ttsafe-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (ttsafe-shared SHARED)
- target_link_libraries (ttsafe-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ target_link_libraries (ttsafe-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>)
set_target_properties (ttsafe-shared PROPERTIES FOLDER test)
endif ()
diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake
index 791f75c..64ccacd 100644
--- a/test/CMakeVFDTests.cmake
+++ b/test/CMakeVFDTests.cmake
@@ -142,7 +142,7 @@ endif ()
${vfdname}-shared/${vfdname}-${vfdtest}-shared.out
${vfdname}-shared/${vfdname}-${vfdtest}-shared.out.err
)
- add_test (NAME VFD-${vfdname}-${test}-shared
+ add_test (NAME VFD-${vfdname}-${vfdtest}-shared
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}-shared>"
-D "TEST_ARGS:STRING="
@@ -163,7 +163,7 @@ endif ()
COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}"
)
if (BUILD_SHARED_LIBS)
- add_test (NAME VFD-${vfdname}-${test}-shared
+ add_test (NAME VFD-${vfdname}-${vfdtest}-shared
COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}-shared"
)
endif ()
diff --git a/test/cache_tagging.c b/test/cache_tagging.c
index b91f013..e03defa 100644
--- a/test/cache_tagging.c
+++ b/test/cache_tagging.c
@@ -448,7 +448,7 @@ check_file_creation_tags(hid_t fcpl_id, int type)
TESTING("tag application during file creation");
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create a test file with provided fcpl_t */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl)) < 0 ) TEST_ERROR;
@@ -539,7 +539,7 @@ check_file_open_tags(hid_t fcpl, int type)
/* ===== */
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create a test file with provided fcpl_t */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
@@ -652,7 +652,7 @@ check_group_creation_tags(void)
/* ===== */
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create a test file with provided fcpl_t */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
@@ -751,7 +751,7 @@ check_multi_group_creation_tags(void)
TESTING("tag application during multiple group creation");
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Set latest version of library */
if ( H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) TEST_ERROR;
@@ -881,7 +881,7 @@ check_link_iteration_tags(void)
TESTING("tag application during iteration over links in a group");
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* =========== */
/* Create File */
@@ -1000,7 +1000,7 @@ check_dense_attribute_tags(void)
TESTING("tag application during dense attribute manipulation");
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
if ( H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) TEST_ERROR;
/* Create Dcpl */
@@ -1184,7 +1184,7 @@ check_group_open_tags(void)
/* ===== */
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create a test file with provided fcpl_t */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
@@ -1295,7 +1295,7 @@ check_attribute_creation_tags(hid_t fcpl, int type)
/* ===== */
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create a test file with provided fcpl_t */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
@@ -1429,7 +1429,7 @@ check_attribute_open_tags(hid_t fcpl, int type)
/* ===== */
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create a test file with provided fcpl_t */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
@@ -1576,7 +1576,7 @@ check_attribute_rename_tags(hid_t fcpl, int type)
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create a test file with provided fcpl_t */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
@@ -1761,7 +1761,7 @@ check_attribute_delete_tags(hid_t fcpl, int type)
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create a test file with provided fcpl_t */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
@@ -1917,7 +1917,7 @@ check_dataset_creation_tags(hid_t fcpl, int type)
/* ===== */
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
@@ -2051,7 +2051,7 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type)
/* ===== */
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
@@ -2187,7 +2187,7 @@ check_dataset_open_tags(void)
/* ========= */
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create file */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
@@ -2318,7 +2318,7 @@ check_dataset_write_tags(void)
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create file */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
@@ -2457,7 +2457,7 @@ check_attribute_write_tags(hid_t fcpl, int type)
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create a test file with provided fcpl_t */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
@@ -2613,7 +2613,7 @@ check_dataset_read_tags(void)
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create file */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
@@ -2751,7 +2751,7 @@ check_dataset_size_retrieval(void)
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create file */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
@@ -2890,7 +2890,7 @@ check_dataset_extend_tags(void)
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create file */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
@@ -3017,7 +3017,7 @@ check_object_info_tags(void)
/* ===== */
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create a test file */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
@@ -3126,7 +3126,7 @@ check_object_copy_tags(void)
/* ===== */
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create a test file */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
@@ -3257,7 +3257,7 @@ check_link_removal_tags(hid_t fcpl, int type)
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create file */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
@@ -3416,7 +3416,7 @@ check_link_getname_tags(void)
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create file */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
@@ -3553,7 +3553,7 @@ check_external_link_creation_tags(void)
/* ===== */
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create a test file */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
@@ -3660,7 +3660,7 @@ check_external_link_open_tags(void)
/* ===== */
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create a test file */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
@@ -3787,7 +3787,7 @@ check_invalid_tag_application(void)
#if H5C_DO_TAGGING_SANITY_CHECKS
/* Create Fapl */
- if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Create a test file */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
diff --git a/test/direct_chunk.c b/test/direct_chunk.c
index 2edfe64..8de923e 100644
--- a/test/direct_chunk.c
+++ b/test/direct_chunk.c
@@ -58,6 +58,14 @@
#define OVERWRITE_CHUNK_NY 2
#define OVERWRITE_VALUE 42
+/* Test configurations */
+#define CONFIG_LATEST 0x01
+#define CONFIG_REOPEN_FILE 0x02
+#define CONFIG_REOPEN_DSET 0x04
+#define CONFIG_DIRECT_WRITE 0x08
+#define CONFIG_DIRECT_READ 0x10
+#define CONFIG_END 0x20
+
/* Defines used in test_single_chunk_latest() */
#define FILE "single_latest.h5"
#define DATASET "dataset"
@@ -1973,7 +1981,7 @@ error:
} /* test_read_unallocated_chunk() */
/*-------------------------------------------------------------------------
- * Function: test_single_chunk_latest
+ * Function: test_single_chunk
*
* Purpose: This is to verify the fix for jira issue HDFFV-10425.
* The problem was due to a bug in the internal ilbrary routine
@@ -1989,13 +1997,16 @@ error:
* index for the dataset.
* Verify that the data read is the same as the written data.
*
+ * Since expanded to test multiple combinations of cases
+ * involving a single chunk
+ *
* Return: Success: 0
* Failure: 1
*
*-------------------------------------------------------------------------
*/
static int
-test_single_chunk_latest(void)
+test_single_chunk(unsigned config)
{
hid_t fid; /* File ID */
hid_t fapl; /* File access property list ID */
@@ -2005,11 +2016,12 @@ test_single_chunk_latest(void)
hsize_t dims[2] = {DIM0, DIM1}; /* Dimension sizes */
hsize_t chunk[2] = {CHUNK0, CHUNK1}; /* Chunk dimension sizes */
hsize_t offset[2] = {0,0}; /* Offset for writing */
+ uint32_t filters; /* Filter mask out */
int wdata[DIM0][DIM1]; /* Write buffer */
int rdata[DIM0][DIM1]; /* Read buffer */
int i, j; /* Local index variable */
- TESTING("H5Dwrite_chunk with single chunk and latest format");
+ TESTING("Single chunk I/O");
/* Initialize data */
for (i=0; i<DIM0; i++) {
@@ -2020,8 +2032,9 @@ test_single_chunk_latest(void)
/* Create a new file with the latest format */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
goto error;
- if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- goto error;
+ if(config & CONFIG_LATEST)
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ goto error;
if((fid = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
@@ -2039,37 +2052,57 @@ test_single_chunk_latest(void)
if((did = H5Dcreate2(fid, DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
- /* Write the data directly to the dataset */
- if(H5Dwrite_chunk(did, H5P_DEFAULT, 0, offset, CHUNK0*CHUNK1*4, (void *)wdata) < 0)
- goto error;
+ if(config & CONFIG_DIRECT_WRITE) {
+ /* Write the data directly to the dataset */
+ if(H5Dwrite_chunk(did, H5P_DEFAULT, 0, offset, CHUNK0*CHUNK1*4, (void *)wdata) < 0)
+ goto error;
+ } /* end if */
+ else
+ /* Write the data to the dataset */
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)wdata) < 0)
+ goto error;
/*
* Close and release resources.
*/
if(H5Pclose(dcpl) < 0)
goto error;
- if(H5Dclose(did) < 0)
- goto error;
+ if(config & CONFIG_REOPEN_DSET)
+ if(H5Dclose(did) < 0)
+ goto error;
if(H5Sclose(sid) < 0)
goto error;
if(H5Pclose(fapl) < 0)
goto error;
- if(H5Fclose(fid) < 0)
- goto error;
+ if(config & CONFIG_REOPEN_FILE)
+ if(H5Fclose(fid) < 0)
+ goto error;
/* Open the file and dataset with default properties */
- if((fid = H5Fopen(FILE, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
- goto error;
- if((did = H5Dopen2(fid, DATASET, H5P_DEFAULT)) < 0)
- goto error;
+ if(config & CONFIG_REOPEN_FILE)
+ if((fid = H5Fopen(FILE, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
+ goto error;
+ if(config & CONFIG_REOPEN_DSET)
+ if((did = H5Dopen2(fid, DATASET, H5P_DEFAULT)) < 0)
+ goto error;
/* Retrieve dataset creation property list */
if((dcpl = H5Dget_create_plist(did)) < 0)
goto error;
- /* Read the data */
- if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata) < 0)
- goto error;
+ if(config & CONFIG_DIRECT_READ) {
+ /* Read the data directly */
+ if(H5Dread_chunk(did, H5P_DEFAULT, offset, &filters, rdata) < 0)
+ goto error;
+
+ /* Verify returned filter mask */
+ if(filters != 0)
+ goto error;
+ } /* end if */
+ else
+ /* Read the data */
+ if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata) < 0)
+ goto error;
/* Verify that the data read was correct. */
for (i = 0; i < DIM0; i++) {
@@ -2122,6 +2155,7 @@ error:
int main( void )
{
hid_t file_id;
+ unsigned config;
int nerrors=0;
/*
@@ -2149,7 +2183,53 @@ int main( void )
nerrors += test_read_unfiltered_dset(file_id);
nerrors += test_read_unallocated_chunk(file_id);
- nerrors += test_single_chunk_latest();
+ /* Loop over test configurations */
+ for(config = 0; config < CONFIG_END; config++) {
+ hbool_t need_comma = FALSE;
+
+ /* Check for invalid combinations */
+ if((config & CONFIG_REOPEN_FILE) && !(config & CONFIG_REOPEN_DSET))
+ continue;
+
+ /* Print configuration */
+ printf("Configuration: ");
+ if(config == 0)
+ printf("<empty>");
+ if(config & CONFIG_LATEST) {
+ if(need_comma)
+ printf(", ");
+ printf("latest format");
+ need_comma = TRUE;
+ } /* end if */
+ if(config & CONFIG_REOPEN_FILE) {
+ if(need_comma)
+ printf(", ");
+ printf("reopen file");
+ need_comma = TRUE;
+ } /* end if */
+ else if(config & CONFIG_REOPEN_DSET) {
+ if(need_comma)
+ printf(", ");
+ printf("reopen dataset");
+ need_comma = TRUE;
+ } /* end if */
+ if(config & CONFIG_DIRECT_WRITE) {
+ if(need_comma)
+ printf(", ");
+ printf("direct write");
+ need_comma = TRUE;
+ } /* end if */
+ if(config & CONFIG_DIRECT_READ) {
+ if(need_comma)
+ printf(", ");
+ printf("direct read");
+ need_comma = TRUE;
+ } /* end if */
+ printf(":\n");
+ fflush(stdout);
+
+ nerrors += test_single_chunk(config);
+ } /* end for */
if(H5Fclose(file_id) < 0)
goto error;
@@ -2165,3 +2245,4 @@ error:
HDputs("*** TESTS FAILED ***");
return EXIT_FAILURE;
}
+
diff --git a/test/dsets.c b/test/dsets.c
index 5de9cfa..ef3cf58 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -835,8 +835,8 @@ test_compact_io(hid_t fapl)
skipping invalid combinations.
- Create a file, create and write a compact dataset, and verify its data
- Verify the dataset's layout and fill message versions */
- for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
- for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
/* Set version bounds */
H5E_BEGIN_TRY {
@@ -10331,8 +10331,8 @@ test_zero_dim_dset(hid_t fapl)
/* Loop through all the combinations of low/high library format bounds,
skipping invalid combination, and verify support for reading a 1D
chunked dataset with dimension size = 0 */
- for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
- for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
/* Set version bounds before opening the file */
H5E_BEGIN_TRY {
@@ -12961,8 +12961,8 @@ test_versionbounds(void)
/* Create a source file and a dataset in it. Create a virtual file and
virtual dataset. Creation of virtual dataset should only succeed in
H5F_LIBVER_V110 */
- for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
- for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
/* Set version bounds, skip for invalid low/high combination */
H5E_BEGIN_TRY {
diff --git a/test/dtypes.c b/test/dtypes.c
index 7e5a992..2056245 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -6837,8 +6837,8 @@ test_delete_obj_named(hid_t fapl)
/* Loop through all valid the combinations of low/high library format bounds,
to test delete objects that use named datatypes through different file IDs */
- for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
- for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
/* Skip invalid low/high combination */
if ((high == H5F_LIBVER_EARLIEST) || (low > high))
@@ -6938,8 +6938,8 @@ test_delete_obj_named_fileid(hid_t fapl)
h5_fixname(FILENAME[9], fapl2, filename2, sizeof filename2);
/* Loop through all the combinations of low/high library format bounds */
- for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
- for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
/* Skip invalid low/high combination */
if ((high == H5F_LIBVER_EARLIEST) || (low > high))
@@ -7627,7 +7627,10 @@ test_versionbounds(void)
H5F_t *filep = NULL; /* Pointer to internal structure of a file */
H5T_t *dtypep = NULL; /* Pointer to internal structure of a datatype */
hsize_t arr_dim[] = {ARRAY_LEN}; /* Length of the array */
+ int i, j; /* Indices for iterating over versions */
H5F_libver_t low, high; /* File format bounds */
+ H5F_libver_t versions[] = {H5F_LIBVER_EARLIEST, H5F_LIBVER_V18, H5F_LIBVER_V110};
+ int versions_count = 3; /* Number of version bounds in the array */
unsigned highest_version; /* Highest version in nested datatypes */
color_t enum_val; /* Enum type index */
herr_t ret = 0; /* Generic return value */
@@ -7691,19 +7694,19 @@ test_versionbounds(void)
ret = H5Tenum_insert(enum_type, "RED", &enum_val);
if (ret < 0) TEST_ERROR
- enum_val++;
+ enum_val = E1_GREEN;
ret = H5Tenum_insert(enum_type, "GREEN", &enum_val);
if (ret < 0) TEST_ERROR
- enum_val++;
+ enum_val = E1_BLUE;
ret = H5Tenum_insert(enum_type, "BLUE", &enum_val);
if (ret < 0) TEST_ERROR
- enum_val++;
+ enum_val = E1_ORANGE;
ret = H5Tenum_insert(enum_type, "ORANGE", &enum_val);
if (ret < 0) TEST_ERROR
- enum_val++;
+ enum_val = E1_YELLOW;
ret = H5Tenum_insert(enum_type, "YELLOW", &enum_val);
if (ret < 0) TEST_ERROR
@@ -7727,8 +7730,9 @@ test_versionbounds(void)
skipping invalid combinations */
/* Create the file, create and write to a dataset with compound datatype */
/* Verify the dataset's datatype and its members */
- for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
- for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ for(i = 0, low = versions[i]; i < versions_count; i++) {
+
+ for(j = 0, high = versions[j]; j < versions_count; j++) {
/* Set version bounds */
H5E_BEGIN_TRY {
diff --git a/test/h5test.c b/test/h5test.c
index 0ba28f3..bc3f2fa 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -44,12 +44,6 @@
* is interpreted according to the driver. See
* h5_get_vfd_fapl() for details.
*
- * HDF5_VOL_CONNECTOR: This string describes what VOL connector to
- * use for HDF5 file access. The first word in the
- * value is the name of the connector and subsequent data
- * is interpreted according to the connector. See
- * h5_get_vol_fapl() for details.
- *
* HDF5_LIBVER_BOUNDS: This string describes what library version bounds to
* use for HDF5 file access. See h5_get_libver_fapl() for details.
*
@@ -785,10 +779,6 @@ h5_fileaccess(void)
if(h5_get_vfd_fapl(fapl_id) < 0)
goto error;
- /* Next, try to set up a VOL connector */
- if(h5_get_vol_fapl(fapl_id) < 0)
- goto error;
-
/* Finally, check for libver bounds */
if(h5_get_libver_fapl(fapl_id) < 0)
goto error;
@@ -829,10 +819,6 @@ h5_fileaccess_flags(unsigned flags)
if((flags & H5_FILEACCESS_VFD) && h5_get_vfd_fapl(fapl_id) < 0)
goto error;
- /* Next, try to set up a VOL connector */
- if((flags & H5_FILEACCESS_VOL) && h5_get_vol_fapl(fapl_id) < 0)
- goto error;
-
/* Finally, check for libver bounds */
if((flags & H5_FILEACCESS_LIBVER) && h5_get_libver_fapl(fapl_id) < 0)
goto error;
@@ -1046,110 +1032,6 @@ error:
/*-------------------------------------------------------------------------
- * Function: h5_get_vol_fapl
- *
- * Purpose: Returns a file access property list which is the default
- * fapl but with a VOL connector set according to the constant
- * or environment variable HDF5_VOL_CONNECTOR.
- *
- * Return: Success: 0
- * Failure: -1
- *
- * Programmer: Jordan Henderson
- * November 2018
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-h5_get_vol_fapl(hid_t fapl)
-{
- const char *env = NULL;
- const char *tok = NULL;
- char *lasts = NULL; /* Context pointer for strtok_r() call */
- htri_t connector_is_registered;
- char buf[1024]; /* Buffer for tokenizing HDF5_VOL_CONNECTOR */
- void *vol_info = NULL; /* VOL connector info */
- hid_t connector_id = -1;
-
- /* Get the environment variable, if it exists */
- env = HDgetenv("HDF5_VOL_CONNECTOR");
-#ifdef HDF5_VOL_CONNECTOR
- /* Use the environment variable, then the compile-time constant */
- if(!env)
- env = HDF5_VOL_CONNECTOR;
-#endif
-
- /* If the environment variable was not set, just return. */
- if(!env || !*env)
- goto done;
-
- /* Get the first 'word' of the environment variable.
- * If it's nothing (environment variable was whitespace) just return.
- */
- HDstrncpy(buf, env, sizeof(buf));
- buf[sizeof(buf) - 1] = '\0';
- if(NULL == (tok = HDstrtok_r(buf, " \t\n\r", &lasts)))
- goto done;
-
- /* First, check to see if the connector is already registered */
- if((connector_is_registered = H5VLis_connector_registered(tok)) < 0)
- goto done;
- else if(connector_is_registered) {
- /* Retrieve the ID of the already-registered VOL connector */
- if((connector_id = H5VLget_connector_id(tok)) < 0)
- goto error;
- } /* end else-if */
- else {
- /* Check for VOL connectors that ship with the library */
- if(!HDstrcmp(tok, "native")) {
- connector_id = H5VL_NATIVE;
- if(H5Iinc_ref(connector_id) < 0)
- goto error;
- } else if(!HDstrcmp(tok, "pass_through")) {
- connector_id = H5VL_PASSTHRU;
- if(H5Iinc_ref(connector_id) < 0)
- goto error;
- } else {
- /* Register the VOL connector */
- /* (NOTE: No provisions for vipl_id currently) */
- if((connector_id = H5VLregister_connector_by_name(tok, H5P_DEFAULT)) < 0)
- goto error;
- } /* end else */
- } /* end else */
-
- /* Was there any connector info specified in the environment variable? */
- if(NULL != (tok = HDstrtok_r(NULL, " \t\n\r", &lasts)))
- if(H5VLconnector_str_to_info(tok, connector_id, &vol_info) < 0)
- goto error;
-
- /* Set the VOL connector in the FAPL */
- if(H5Pset_vol(fapl, connector_id, vol_info) < 0)
- goto error;
-
- /* Release VOL connector info, if there was any */
- if(vol_info)
- if(H5VLfree_connector_info(connector_id, vol_info) < 0)
- goto error;
-
- /* Close the connector ID */
- if(connector_id >= 0)
- if(H5VLunregister_connector(connector_id) < 0)
- goto error;
-
-done:
- return 0;
-
-error:
- if(vol_info)
- H5VLfree_connector_info(connector_id, vol_info);
- if(connector_id >= 0)
- H5VLunregister_connector(connector_id);
-
- return -1;
-} /* end h5_get_vol_fapl() */
-
-
-/*-------------------------------------------------------------------------
* Function: h5_no_hwconv
*
* Purpose: Turn off hardware data type conversions.
diff --git a/test/h5test.h b/test/h5test.h
index 66a7863..8c3ce6b 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -123,8 +123,7 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
/* Flags for h5_fileaccess_flags() */
#define H5_FILEACCESS_VFD 0x01
-#define H5_FILEACCESS_VOL 0x02
-#define H5_FILEACCESS_LIBVER 0x04
+#define H5_FILEACCESS_LIBVER 0x02
#ifdef __cplusplus
extern "C" {
@@ -152,7 +151,6 @@ H5TEST_DLL H5VL_class_t *h5_get_dummy_vol_class(void);
/* Functions that will replace components of a FAPL */
H5TEST_DLL herr_t h5_get_vfd_fapl(hid_t fapl_id);
-H5TEST_DLL herr_t h5_get_vol_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/objcopy.c b/test/objcopy.c
index 4055781..df1c0e4 100644
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -2197,8 +2197,8 @@ test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src)
/* Loop through all the combinations of low/high library format bounds,
skipping invalid combinations. Create a destination file and copy the
source dataset to it, then verify */
- for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
- for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
/* Set version bounds */
H5E_BEGIN_TRY {
@@ -7869,7 +7869,7 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open)
addr_reset();
/* Setup */
- if((src_fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0) TEST_ERROR
+ if((src_fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0) TEST_ERROR
/* open source file (read-only) */
if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR
diff --git a/test/ohdr.c b/test/ohdr.c
index 85554a5..b8f7112 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -1716,8 +1716,8 @@ main(void)
api_ctx_pushed = TRUE;
/* Loop through all the combinations of low/high library format bounds */
- for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
- for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
char *low_string = NULL;
char *high_string = NULL;
diff --git a/test/set_extent.c b/test/set_extent.c
index 5d11819..f6b02cf 100644
--- a/test/set_extent.c
+++ b/test/set_extent.c
@@ -433,8 +433,8 @@ static int do_layouts( hid_t fapl )
TESTING("storage layout use - tested with all low/high library format bounds");
/* Loop through all the combinations of low/high library format bounds */
- for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
- for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
/* Copy plist to use locally to avoid modifying the original */
new_fapl = H5Pcopy(fapl);
diff --git a/test/testerror.sh.in b/test/testerror.sh.in
index 734b051..ac2a109 100644
--- a/test/testerror.sh.in
+++ b/test/testerror.sh.in
@@ -22,7 +22,9 @@ CMP='cmp -s'
DIFF='diff -c'
# Skip plugin module to test missing filter
-ENVCMD="env HDF5_PLUGIN_PRELOAD=::"
+# Also reset the VOL connector to only use the native connector, because of the
+# error stack checking. QAK - 2019/03/09
+ENVCMD="env HDF5_PLUGIN_PRELOAD=:: HDF5_VOL_CONNECTOR=native"
nerrors=0
verbose=yes
diff --git a/test/tfile.c b/test/tfile.c
index c5e913c..e3ff372 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -5148,7 +5148,7 @@ test_libver_bounds_open(void)
/* Opening VERBFNAME in these combination should succeed.
For each low bound, verify that it is upgraded properly */
high = H5F_LIBVER_LATEST;
- for (low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++)
+ for (low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low))
{
H5F_libver_t new_low = H5F_LIBVER_EARLIEST;
@@ -5241,8 +5241,8 @@ test_libver_bounds_low_high(void)
CHECK(fapl, FAIL, "H5Pcreate");
/* Loop through all the combinations of low/high version bounds */
- for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++)
- for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low))
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
H5E_BEGIN_TRY {
/* Set the low/high version bounds */
@@ -5610,8 +5610,8 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr)
CHECK(new_fapl, FAIL, "H5Pcreate");
/* Loop through all the combinations of low/high bounds in new_fapl */
- for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
- for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
H5E_BEGIN_TRY {
ret = H5Pset_libver_bounds(new_fapl, low, high);
} H5E_END_TRY;
@@ -5782,8 +5782,8 @@ test_libver_bounds_obj(hid_t fapl)
/* Loop through all the combinations of low/high bounds in new_fapl */
/* Open the file with the fapl; create a group and verify the
object header version, then delete the group and close the file.*/
- for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
- for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
H5E_BEGIN_TRY {
ret = H5Pset_libver_bounds(new_fapl, low, high);
} H5E_END_TRY;
@@ -5993,8 +5993,8 @@ 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 */
- for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
- for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
H5E_BEGIN_TRY {
ret = H5Pset_libver_bounds(new_fapl, low, high);
} H5E_END_TRY;
@@ -6206,8 +6206,8 @@ test_libver_bounds_dataspace(hid_t fapl)
/* Loop through all the combinations of low/high bounds in new_fapl */
/* Open the file and create the chunked/compact/contiguous datasets */
/* Verify the dataspace message version for the three datasets */
- for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
- for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
hid_t tmp_sid, tmp_sid_compact, tmp_sid_contig; /* Dataspace IDs */
H5S_t *tmp_space, *tmp_space_compact, *tmp_space_contig; /* Internal dataspace pointers */
@@ -6531,8 +6531,8 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid)
/* Open the file and create the chunked dataset with the input tid */
/* Verify the dataset's datatype message version */
/* Also verify the committed atatype message version */
- for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
- for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
H5E_BEGIN_TRY {
ret = H5Pset_libver_bounds(new_fapl, low, high);
} H5E_END_TRY;
@@ -6852,8 +6852,8 @@ test_libver_bounds_attributes(hid_t fapl)
/* Loop through all the combinations of low/high bounds */
/* Open the file and group and attach an attribute to the group */
/* Verify the attribute version */
- for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
- for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
H5E_BEGIN_TRY {
ret = H5Pset_libver_bounds(new_fapl, low, high);
} H5E_END_TRY;
diff --git a/test/th5o.c b/test/th5o.c
index 63fee5f..0aa589f 100644
--- a/test/th5o.c
+++ b/test/th5o.c
@@ -806,8 +806,8 @@ test_h5o_link(void)
CHECK(fapl_id, FAIL, "H5Pcreate");
/* Loop through all the combinations of low/high library format bounds */
- for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
- for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
/* Set version bounds */
H5E_BEGIN_TRY {
diff --git a/test/tid.c b/test/tid.c
index 8a27c3b..7f61c6a 100644
--- a/test/tid.c
+++ b/test/tid.c
@@ -251,7 +251,10 @@ static int id_predefined_test(void )
testObj = HDmalloc(sizeof(int));
- /* Try to perform illegal functions on various predefined types */
+ /*
+ * Attempt to perform public functions on various library types
+ */
+
H5E_BEGIN_TRY
testID = H5Iregister(H5I_FILE, testObj);
H5E_END_TRY
@@ -292,7 +295,26 @@ static int id_predefined_test(void )
if(testErr >= 0)
goto out;
- /* Create a datatype ID and try to perform illegal functions on it */
+ H5E_BEGIN_TRY
+ testErr = H5Itype_exists(H5I_GROUP);
+ H5E_END_TRY
+
+ VERIFY(testErr, -1, "H5Itype_exists");
+ if(testErr != -1)
+ goto out;
+
+ H5E_BEGIN_TRY
+ testErr = H5Itype_exists(H5I_ATTR);
+ H5E_END_TRY
+
+ VERIFY(testErr, -1, "H5Itype_exists");
+ if(testErr != -1)
+ goto out;
+
+ /*
+ * Create a datatype ID and try to perform illegal functions on it
+ */
+
typeID = H5Tcreate(H5T_OPAQUE, (size_t)42);
CHECK(typeID, H5I_INVALID_HID, "H5Tcreate");
if(typeID == H5I_INVALID_HID)
@@ -317,7 +339,7 @@ static int id_predefined_test(void )
H5Tclose(typeID);
/* testObj was never registered as an atom, so it will not be
- * automatically freed. */
+ * automatically freed. */
HDfree(testObj);
return 0;
diff --git a/test/titerate.c b/test/titerate.c
index 8c0ef24..54e9b5e 100644
--- a/test/titerate.c
+++ b/test/titerate.c
@@ -945,7 +945,7 @@ find_err_msg_cb(unsigned n, const H5E_error2_t *err_desc, void *_client_data)
searched_err_t *searched_err = (searched_err_t *)_client_data;
if (searched_err == NULL)
- return -1;
+ return H5_ITER_ERROR;
/* If the searched error message is found, stop the iteration */
if (err_desc->desc != NULL && strcmp(err_desc->desc, searched_err->message) == 0)
@@ -953,6 +953,7 @@ find_err_msg_cb(unsigned n, const H5E_error2_t *err_desc, void *_client_data)
searched_err->found = true;
status = H5_ITER_STOP;
}
+
return status;
} /* end find_err_msg_cb() */
@@ -988,6 +989,7 @@ static void test_corrupted_attnamelen(void)
/* Call H5Aiterate2 to trigger the failure in HDFFV-10588. Failure should
occur in the decoding stage, so some arguments are not needed. */
err_status = H5Aiterate2(did, H5_INDEX_NAME, H5_ITER_INC, NULL, NULL, NULL);
+ VERIFY(err_status, FAIL, "H5Aiterate2");
/* Make sure the intended error was caught */
if(err_status == -1)
diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c
index 56d87ee..5e26888 100644
--- a/test/ttsafe_error.c
+++ b/test/ttsafe_error.c
@@ -63,6 +63,8 @@ static void *tts_error_thread(void *);
void
tts_error(void)
{
+ hid_t def_fapl = H5I_INVALID_HID;
+ hid_t vol_id = H5I_INVALID_HID;
hid_t dataset = H5I_INVALID_HID;
H5TS_thread_t threads[NUM_THREAD];
H5TS_attr_t attribute;
@@ -111,39 +113,52 @@ tts_error(void)
H5TS_attr_setscope(&attribute, H5TS_SCOPE_SYSTEM);
#endif /* H5_HAVE_SYSTEM_SCOPE_THREADS */
- /* Create a hdf5 file using H5F_ACC_TRUNC access, default file
- * creation plist and default file access plist
- */
- error_file_g = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(error_file_g, H5I_INVALID_HID, "H5Fcreate");
+ def_fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(def_fapl, H5I_INVALID_HID, "H5Pcreate");
- for (i = 0; i < NUM_THREAD; i++)
- threads[i] = H5TS_create_thread(tts_error_thread, &attribute, NULL);
+ status = H5Pget_vol_id(def_fapl, &vol_id);
+ CHECK(status, FAIL, "H5Pget_vol_id");
- for (i = 0; i < NUM_THREAD; i++)
- H5TS_wait_for_thread(threads[i]);
+ if(vol_id == H5VL_NATIVE) {
+ /* Create a hdf5 file using H5F_ACC_TRUNC access, default file
+ * creation plist and default file access plist
+ */
+ error_file_g = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, def_fapl);
+ CHECK(error_file_g, H5I_INVALID_HID, "H5Fcreate");
- if (error_flag_g) {
- TestErrPrintf("At least one thread reported a value that was different from the expected value\n");
- HDprintf("(Update this test if the error stack changed!)\n");
- }
+ for (i = 0; i < NUM_THREAD; i++)
+ threads[i] = H5TS_create_thread(tts_error_thread, &attribute, NULL);
+
+ for (i = 0; i < NUM_THREAD; i++)
+ H5TS_wait_for_thread(threads[i]);
+
+ if (error_flag_g) {
+ TestErrPrintf("At least one thread reported a value that was different from the expected value\n");
+ HDprintf("(Update this test if the error stack changed!)\n");
+ }
- if (error_count_g != NUM_THREAD - 1)
- TestErrPrintf("Error: %d threads failed instead of %d\n", error_count_g, NUM_THREAD-1);
+ if (error_count_g != NUM_THREAD - 1)
+ TestErrPrintf("Error: %d threads failed instead of %d\n", error_count_g, NUM_THREAD-1);
- dataset = H5Dopen2(error_file_g, DATASETNAME, H5P_DEFAULT);
- CHECK(dataset, H5I_INVALID_HID, "H5Dopen2");
+ dataset = H5Dopen2(error_file_g, DATASETNAME, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dopen2");
- status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &value);
- CHECK(status, FAIL, "H5Dread");
+ status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &value);
+ CHECK(status, FAIL, "H5Dread");
- if (value != WRITE_NUMBER)
- TestErrPrintf("Error: Successful thread wrote value %d instead of %d\n", value, WRITE_NUMBER);
+ if (value != WRITE_NUMBER)
+ TestErrPrintf("Error: Successful thread wrote value %d instead of %d\n", value, WRITE_NUMBER);
- status = H5Dclose(dataset);
- CHECK(status, FAIL, "H5Dclose");
- status = H5Fclose(error_file_g);
- CHECK(status, FAIL, "H5Fclose");
+ status = H5Dclose(dataset);
+ CHECK(status, FAIL, "H5Dclose");
+ status = H5Fclose(error_file_g);
+ CHECK(status, FAIL, "H5Fclose");
+ } /* end if */
+ else
+ HDprintf("Non-native VOL connector used, skipping test\n");
+
+ status = H5Idec_ref(vol_id);
+ CHECK(status, FAIL, "H5Idec_ref");
H5TS_attr_destroy(&attribute);
} /* end tts_error() */