summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am5
-rw-r--r--test/accum.c11
-rw-r--r--test/cache_image.c12
-rw-r--r--test/cache_tagging.c204
-rw-r--r--test/chunk_info.c150
-rw-r--r--test/cmpd_dset.c6
-rw-r--r--test/dsets.c15
-rw-r--r--test/dtypes.c16
-rw-r--r--test/file_image.c3
-rw-r--r--test/freespace.c6
-rw-r--r--test/h5test.c381
-rw-r--r--test/h5test.h10
-rw-r--r--test/links_env.c5
-rw-r--r--test/objcopy.c12
-rw-r--r--test/ohdr.c2
-rw-r--r--test/swmr.c6
-rw-r--r--test/testfiles/error_test_117
-rw-r--r--test/tfile.c41
-rw-r--r--test/tmisc.c22
-rw-r--r--test/ttsafe_error.c25
-rw-r--r--test/vds_swmr_gen.c2
-rw-r--r--test/vds_swmr_reader.c9
-rw-r--r--test/vds_swmr_writer.c2
-rw-r--r--test/vol.c149
24 files changed, 651 insertions, 460 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index 61dcda8..1526eca 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -144,6 +144,11 @@ if DIRECT_VFD_CONDITIONAL
VFD_LIST += direct
endif
+# Test with just the native connector, with a single pass-through connector
+# and with a doubly-stacked pass-through.
+VOL_LIST = native "pass_through under_vol=0;under_info={}" \
+ "pass_through under_vol=505;under_info={under_vol=0;under_info={}}"
+
# Additional target for running timing test
timings _timings: testmeta
@for timing in $(TIMINGS) dummy; do \
diff --git a/test/accum.c b/test/accum.c
index 40829f9..87628d8 100644
--- a/test/accum.c
+++ b/test/accum.c
@@ -91,14 +91,23 @@ main(void)
unsigned nerrors = 0; /* track errors */
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
hid_t fid = -1;
+ hid_t fapl = -1; /* File access property list */
H5F_t * f = NULL; /* File for all tests */
/* Test Setup */
puts("Testing the metadata accumulator");
+ /* File access property list */
+ if((fapl = h5_fileaccess()) < 0)
+ FAIL_STACK_ERROR
+
/* Create a test file */
- if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+
+ /* Closing and remove the file */
+ if(H5Pclose(fapl) < 0)
+ FAIL_STACK_ERROR
/* Push API context */
if(H5CX_push() < 0) FAIL_STACK_ERROR
diff --git a/test/cache_image.c b/test/cache_image.c
index 4d6b065..10e9a8a 100644
--- a/test/cache_image.c
+++ b/test/cache_image.c
@@ -586,12 +586,12 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
/* create a file access propertly list. */
if ( pass ) {
- fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ fapl_id = h5_fileaccess();
if ( fapl_id < 0 ) {
pass = FALSE;
- failure_mssg = "H5Pcreate() failed.\n";
+ failure_mssg = "h5_fileaccess() failed.\n";
}
}
@@ -928,12 +928,12 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file,
/* create a file access propertly list. */
if ( pass ) {
- fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ fapl_id = h5_fileaccess();
if ( fapl_id < 0 ) {
pass = FALSE;
- failure_mssg = "H5Pcreate() failed.\n";
+ failure_mssg = "h5_fileaccess() failed.\n";
}
}
@@ -6688,12 +6688,12 @@ cache_image_api_error_check_4(void)
*/
if ( pass ) {
- fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ fapl_id = h5_fileaccess();
if ( fapl_id < 0 ) {
pass = FALSE;
- failure_mssg = "H5Pcreate() failed.\n";
+ failure_mssg = "h5_fileaccess() failed.\n";
}
}
diff --git a/test/cache_tagging.c b/test/cache_tagging.c
index 8d90eb6..752dd27 100644
--- a/test/cache_tagging.c
+++ b/test/cache_tagging.c
@@ -440,14 +440,20 @@ check_file_creation_tags(hid_t fcpl_id, int type)
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
int verbose = FALSE; /* verbose test outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t sbe_tag = 0;
/* Testing Macro */
TESTING("tag application during file creation");
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
#ifndef NDEBUG
/* if verbose, print cache index to screen before verification . */
@@ -521,6 +527,7 @@ check_file_open_tags(hid_t fcpl, int type)
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
int verbose = FALSE; /* verbose file outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag; /* Root Group Tag */
haddr_t sbe_tag; /* Sblock Extension Tag */
@@ -531,8 +538,13 @@ check_file_open_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -628,6 +640,7 @@ check_group_creation_tags(void)
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
int verbose = FALSE; /* verbose file outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = HADDR_UNDEF; /* Root Group Tag */
haddr_t g_tag; /* Group Tag */
@@ -638,8 +651,13 @@ check_group_creation_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -733,7 +751,7 @@ check_multi_group_creation_tags(void)
TESTING("tag application during multiple group creation");
/* Create Fapl */
- if ( (fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
/* Set latest version of library */
if ( H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) TEST_ERROR;
@@ -816,6 +834,7 @@ check_multi_group_creation_tags(void)
/* Close open objects and file */
/* =========================== */
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
/* ========================================== */
@@ -855,15 +874,21 @@ check_link_iteration_tags(void)
haddr_t root_tag = 0; /* Root Group Tag Value */
char dsetname[500]; /* Name of dataset */
H5G_info_t ginfo; /* Group Info Struct */
+ hid_t fapl = -1; /* File access prop list */
hid_t root_group = -1; /* Root Group Identifier */
/* Testing Macro */
TESTING("tag application during iteration over links in a group");
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* =========== */
/* Create File */
/* =========== */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* Get root group tag */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -975,7 +1000,7 @@ check_dense_attribute_tags(void)
TESTING("tag application during dense attribute manipulation");
/* Create Fapl */
- if ( (fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
if ( H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) TEST_ERROR;
/* Create Dcpl */
@@ -986,6 +1011,8 @@ check_dense_attribute_tags(void)
/* =========== */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
+
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1145,6 +1172,7 @@ check_group_open_tags(void)
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
int verbose = FALSE; /* verbose file output */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = HADDR_UNDEF;
haddr_t g_tag;
@@ -1155,8 +1183,13 @@ check_group_open_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1248,6 +1281,7 @@ check_attribute_creation_tags(hid_t fcpl, int type)
hid_t gid = -1; /* Group Identifier */
hid_t sid = -1; /* Dataspace Identifier */
int verbose = FALSE; /* verbose file outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0; /* Root group tag */
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1260,8 +1294,11 @@ check_attribute_creation_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1341,6 +1378,7 @@ check_attribute_creation_tags(hid_t fcpl, int type)
if ( H5Aclose(aid) < 0 ) TEST_ERROR;
if ( H5Gclose(gid) < 0 ) TEST_ERROR;
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
/* ========================================== */
@@ -1377,6 +1415,7 @@ check_attribute_open_tags(hid_t fcpl, int type)
hid_t gid = -1; /* Group Identifier */
hid_t sid = -1; /* Dataspace Identifier */
int verbose = FALSE; /* verbose file outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1389,8 +1428,13 @@ check_attribute_open_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1510,6 +1554,7 @@ check_attribute_rename_tags(hid_t fcpl, int type)
int verbose = FALSE; /* verbose file outout */
int *data = NULL; /* data buffer */
int i,j,k = 0; /* iterators */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1530,8 +1575,13 @@ check_attribute_rename_tags(hid_t fcpl, int type)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1689,6 +1739,7 @@ check_attribute_delete_tags(hid_t fcpl, int type)
int verbose = FALSE; /* verbose file outout */
int *data = NULL; /* data buffer */
int i,j,k = 0; /* iterators */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1709,8 +1760,13 @@ check_attribute_delete_tags(hid_t fcpl, int type)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1847,6 +1903,7 @@ check_dataset_creation_tags(hid_t fcpl, int type)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1859,7 +1916,12 @@ check_dataset_creation_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1974,6 +2036,7 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1987,7 +2050,12 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2105,6 +2173,7 @@ check_dataset_open_tags(void)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2117,8 +2186,13 @@ check_dataset_open_tags(void)
/* Open File */
/* ========= */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2225,6 +2299,7 @@ check_dataset_write_tags(void)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2242,8 +2317,13 @@ check_dataset_write_tags(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2360,6 +2440,7 @@ check_attribute_write_tags(hid_t fcpl, int type)
int verbose = FALSE; /* verbose file outout */
int *data = NULL; /* data buffer */
int i,j,k = 0; /* iterators */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2375,8 +2456,13 @@ check_attribute_write_tags(hid_t fcpl, int type)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2508,6 +2594,7 @@ check_dataset_read_tags(void)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2525,8 +2612,13 @@ check_dataset_read_tags(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2639,6 +2731,7 @@ check_dataset_size_retrieval(void)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2657,8 +2750,13 @@ check_dataset_size_retrieval(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2772,6 +2870,7 @@ check_dataset_extend_tags(void)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2790,8 +2889,13 @@ check_dataset_extend_tags(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2900,6 +3004,7 @@ check_object_info_tags(void)
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
int verbose = FALSE; /* verbose file output */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = HADDR_UNDEF;
haddr_t g_tag;
H5O_info_t oinfo; /* Object info struct */
@@ -2911,8 +3016,13 @@ check_object_info_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -3003,6 +3113,7 @@ check_object_copy_tags(void)
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
int verbose = FALSE; /* verbose file output */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = HADDR_UNDEF;
haddr_t g_tag;
haddr_t copy_tag;
@@ -3014,8 +3125,13 @@ check_object_copy_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -3121,6 +3237,7 @@ check_link_removal_tags(hid_t fcpl, int type)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
haddr_t g_tag = 0;
@@ -3139,8 +3256,13 @@ check_link_removal_tags(hid_t fcpl, int type)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -3274,6 +3396,7 @@ check_link_getname_tags(void)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
haddr_t g_tag = 0;
@@ -3292,8 +3415,13 @@ check_link_getname_tags(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -3414,6 +3542,7 @@ check_external_link_creation_tags(void)
hid_t fid2 = -1; /* File Identifier */
hid_t gid = -1; /* Dataspace Identifier */
int verbose = FALSE; /* verbose file outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
/* Testing Macro */
@@ -3423,21 +3552,26 @@ check_external_link_creation_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Close and Reopen the file */
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
- if ( (fid = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl)) < 0 ) TEST_ERROR;
/* Evict as much as we can from the cache so we can track full tag path */
if ( evict_entries(fid) < 0 ) TEST_ERROR;
/* Create a second file */
- if ( (fid2 = H5Fcreate(FILENAME2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid2 = H5Fcreate(FILENAME2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* Create group in second file */
if ( (gid = H5Gcreate2(fid2, GROUPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
@@ -3514,6 +3648,7 @@ check_external_link_open_tags(void)
hid_t gid = -1; /* Dataspace Identifier */
hid_t xid = -1; /* Dataspace Identifier */
int verbose = FALSE; /* verbose file outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t root2_tag = 0;
@@ -3524,14 +3659,19 @@ check_external_link_open_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Create a second file */
- if ( (fid2 = H5Fcreate(FILENAME2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid2 = H5Fcreate(FILENAME2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid2, &root2_tag) < 0 ) TEST_ERROR;
@@ -3638,6 +3778,7 @@ check_invalid_tag_application(void)
hid_t fid = -1;
haddr_t addr;
H5HL_t * lheap = NULL;
+ hid_t fapl = -1; /* File access prop list */
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
#endif /* H5C_DO_TAGGING_SANITY_CHECKS */
@@ -3645,8 +3786,13 @@ check_invalid_tag_application(void)
TESTING("failure on invalid tag application");
#if H5C_DO_TAGGING_SANITY_CHECKS
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* Push API context */
if(H5CX_push() < 0) TEST_ERROR
diff --git a/test/chunk_info.c b/test/chunk_info.c
deleted file mode 100644
index e3006cc..0000000
--- a/test/chunk_info.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the COPYING file, which can be found at the root of the source code *
- * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
- * If you do not have access to either file, you may request a copy from *
- * help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*
- * Programmer: Pedro Vicente <pvn@hdfgroup.edu>
- * April 7, 2008
- *
- * Purpose: Tests the H5Dget_chunk_info API function
- * This program writes a 4x4 dataset by iterating on 2x2 chunks
- * at a time
- */
-
-
-#include "h5test.h"
-
-#define PRINT_DATA
-#define H5FILE_NAME "chunk_info.h5"
-#define DATASETNAME "2d"
-#define RANK 2
-
-
-int main( void )
-{
-
- hid_t fid; /* file ID */
- hid_t did; /* dataset ID */
- hid_t f_sid; /* file space ID */
- hid_t m_sid; /* memory space ID */
- hid_t pid; /* property list ID */
- hsize_t start[2]; /* chunk location to start writing */
- hsize_t dims[2] = { 4, 4};
- hsize_t chunk_dims[2] = { 2, 2 };
- int chunk_data[2][2] = { {1, 1}, {1, 1} };
- int buf[4][4];
- int fillvalue = 0;
- int i, j, ii, jj;
-
- /* create a new file using default properties. */
- if ((fid = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
- /* create the file space */
- if ((f_sid = H5Screate_simple(RANK, dims, dims)) < 0) TEST_ERROR;
- /* create the memory space with chunk dimensions */
- if ((m_sid = H5Screate_simple(RANK, chunk_dims, chunk_dims)) < 0) TEST_ERROR;
- start[0] = 0;
- start[1] = 0;
- if (H5Sselect_hyperslab(m_sid, H5S_SELECT_SET, start, NULL, chunk_dims, NULL) < 0) TEST_ERROR;
-
- TESTING("chunk info");
-
- /*-------------------------------------------------------------------------
- * create a dataset
- *-------------------------------------------------------------------------
- */
-
- /* modify dataset creation properties, i.e. enable chunking. */
- if ((pid = H5Pcreate (H5P_DATASET_CREATE)) < 0) TEST_ERROR;
- if (H5Pset_chunk(pid, RANK, chunk_dims) < 0) TEST_ERROR;
- if (H5Pset_fill_value(pid, H5T_NATIVE_INT, &fillvalue) < 0) TEST_ERROR;
-
- /* create a new dataset */
- if((did = H5Dcreate2(fid , DATASETNAME, H5T_NATIVE_INT, f_sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR;
-
-
- /*-------------------------------------------------------------------------
- * write the dataset in 2x2 chunks
- *-------------------------------------------------------------------------
- */
-
- /* iterate in dim 0 */
- for (j = 0; j < chunk_dims[0]; j++)
- {
-
- /* reset start in dim 1 */
- start[1] = 0;
-
- /* iterate in dim 1 */
- for (i = 0; i < chunk_dims[1]; i++)
- {
-
- /* select file hyperslab to save a 2x2 chunk */
- if (H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, chunk_dims, NULL) < 0) TEST_ERROR;
-
- /* write the data to the hyperslab. */
- if (H5Dwrite(did, H5T_NATIVE_INT, m_sid, f_sid, H5P_DEFAULT, chunk_data) < 0) TEST_ERROR;
-
- /* read back and display complete dataset 4x4 */
- if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR;
-
-
-#if defined (PRINT_DATA)
- printf("\n");
- printf("dataset: \n");
- for (jj = 0; jj < dims[0]; jj++) {
- for (ii = 0; ii < dims[1]; ii++) printf("%d ", buf[jj][ii]);
- printf("\n");
- }
-#endif
-
-
- /* increment start in dim 1 */
- start[1] += 2;
-
-
- }
-
- /* increment start in dim 0 */
- start[0] += 2;
- }
-
-
-
- /*-------------------------------------------------------------------------
- * close
- *-------------------------------------------------------------------------
- */
-
- if (H5Dclose(did) < 0) TEST_ERROR
- if (H5Sclose(f_sid) < 0) TEST_ERROR
- if (H5Sclose(m_sid) < 0) TEST_ERROR
- if (H5Pclose(pid) < 0) TEST_ERROR
- if (H5Fclose(fid) < 0) TEST_ERROR
-
- PASSED();
-
- puts("All chunk info tests passed.");
- return 0;
-
-
-error:
- H5Dclose( did );
- H5Sclose( f_sid );
- H5Sclose( m_sid );
- H5Pclose( pid );
- H5Fclose( fid );
- H5_FAILED();
- return 1;
-}
-
-
-
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index 5d6cfc7..b011bc2 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -2032,7 +2032,7 @@ error:
*-------------------------------------------------------------------------
*/
static unsigned
-test_ooo_order(char *filename)
+test_ooo_order(char *filename, hid_t fapl_id)
{
hid_t file = -1; /* File ID */
hid_t dtype = -1; /* Datatype IDs */
@@ -2042,7 +2042,7 @@ test_ooo_order(char *filename)
TESTING("that compound member insertion order is preserved")
/* Create the file */
- if ((file = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if ((file = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
TEST_ERROR
/* Create the compound */
@@ -2242,7 +2242,7 @@ main (int argc, char *argv[])
nerrors += test_pack_ooo();
puts("Testing compound member ordering:");
- nerrors += test_ooo_order(fname);
+ nerrors += test_ooo_order(fname, fapl_id);
/* Verify symbol table messages are cached */
nerrors += (h5_verify_cached_stabs(FILENAME, fapl_id) < 0 ? 1 : 0);
diff --git a/test/dsets.c b/test/dsets.c
index 050bd8f..5cd376a 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -826,7 +826,7 @@ test_compact_io(hid_t fapl)
**************************************/
/* Create a copy of file access property list */
- if((new_fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR
+ if((new_fapl = new_fapl = h5_fileaccess()) < 0) TEST_ERROR
/* Loop through all the combinations of low/high library format bounds,
skipping invalid combinations.
@@ -1334,6 +1334,19 @@ test_conv_buffer(hid_t fid)
return 0;
error:
+ H5E_BEGIN_TRY {
+ H5Pclose(xfer_list);
+ H5Sclose(space);
+ H5Tclose(arr_type1);
+ H5Tclose(arr_type2);
+ H5Tclose(arr_type3);
+ H5Tclose(ctype1);
+ H5Tclose(ctype2);
+ H5Tclose(arr_type4);
+ H5Tclose(arr_type5);
+ H5Dclose(dataset);
+ } H5E_END_TRY;
+
return -1;
}
diff --git a/test/dtypes.c b/test/dtypes.c
index 3253d6c..7e5a992 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -6957,13 +6957,13 @@ test_delete_obj_named_fileid(hid_t fapl)
/* Verify file ID from dataset matches correct file */
dset_fid = H5Iget_file_id(dset);
- if(dset_fid != filea1) TEST_ERROR
+ if(!H5F__same_file_test(dset_fid, filea1)) TEST_ERROR
H5Fclose(dset_fid);
/* Verify file ID from datatype (from dataset) matches correct file */
type = H5Dget_type(dset);
type_fid = H5Iget_file_id(type);
- if(type_fid != filea1) TEST_ERROR
+ if(!H5F__same_file_test(type_fid, filea1)) TEST_ERROR
H5Fclose(type_fid);
H5Tclose(type);
@@ -6979,13 +6979,13 @@ test_delete_obj_named_fileid(hid_t fapl)
/* Verify file ID from dataset matches correct file */
dset_fid = H5Iget_file_id(dset);
- if(dset_fid != filea1) TEST_ERROR
+ if(!H5F__same_file_test(dset_fid, filea1)) TEST_ERROR
H5Fclose(dset_fid);
/* Verify file ID from datatype (from dataset) matches correct file */
type = H5Dget_type(dset);
type_fid = H5Iget_file_id(type);
- if(type_fid != filea1) TEST_ERROR
+ if(!H5F__same_file_test(type_fid, filea1)) TEST_ERROR
H5Fclose(type_fid);
H5Tclose(type);
@@ -7007,13 +7007,13 @@ test_delete_obj_named_fileid(hid_t fapl)
/* Verify file ID from dataset matches correct file */
attr_fid = H5Iget_file_id(attr);
- if(attr_fid != filea1) TEST_ERROR
+ if(!H5F__same_file_test(attr_fid, filea1)) TEST_ERROR
H5Fclose(attr_fid);
/* Verify file ID from datatype (from dataset) matches correct file */
type = H5Aget_type(attr);
type_fid = H5Iget_file_id(type);
- if(type_fid != filea1) TEST_ERROR
+ if(!H5F__same_file_test(type_fid, filea1)) TEST_ERROR
H5Fclose(type_fid);
H5Tclose(type);
@@ -7029,13 +7029,13 @@ test_delete_obj_named_fileid(hid_t fapl)
/* Verify file ID from dataset matches correct file */
attr_fid = H5Iget_file_id(attr);
- if(attr_fid != filea1) TEST_ERROR
+ if(!H5F__same_file_test(attr_fid, filea1)) TEST_ERROR
H5Fclose(attr_fid);
/* Verify file ID from datatype (from dataset) matches correct file */
type = H5Aget_type(attr);
type_fid = H5Iget_file_id(type);
- if(type_fid != filea1) TEST_ERROR
+ if(!H5F__same_file_test(type_fid, filea1)) TEST_ERROR
H5Fclose(type_fid);
H5Tclose(type);
diff --git a/test/file_image.c b/test/file_image.c
index 12f0a18..0dba236 100644
--- a/test/file_image.c
+++ b/test/file_image.c
@@ -579,7 +579,8 @@ test_core(void)
reset_udata(udata);
file = H5Fopen(copied_filename, H5F_ACC_RDONLY, fapl);
VERIFY(file >= 0, "H5Fopen failed");
- VERIFY(udata->used_callbacks == MALLOC, "opening a core file used the wrong callbacks");
+ VERIFY((udata->used_callbacks == MALLOC) ||
+ (udata->used_callbacks == MALLOC | UDATA_COPY | UDATA_FREE), "opening a core file used the wrong callbacks");
VERIFY(udata->malloc_src == H5FD_FILE_IMAGE_OP_FILE_OPEN, "Malloc callback came from wrong sourc in core open");
/* Close file */
diff --git a/test/freespace.c b/test/freespace.c
index 0011bd2..947b2ce 100644
--- a/test/freespace.c
+++ b/test/freespace.c
@@ -2862,14 +2862,8 @@ main(void)
{
hid_t fapl = -1; /* File access property list for data files */
unsigned nerrors = 0; /* Cumulative error count */
- const char *env_h5_drvr = NULL; /* File Driver value from environment */
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
- /* Get the VFD to use */
- env_h5_drvr = HDgetenv("HDF5_DRIVER");
- if(env_h5_drvr == NULL)
- env_h5_drvr = "nomatch";
-
h5_reset();
if((fapl = h5_fileaccess()) < 0) {
diff --git a/test/h5test.c b/test/h5test.c
index c1cc55b..0805f06 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -42,7 +42,16 @@
* use for HDF5 file access. The first word in the
* value is the name of the driver and subsequent data
* is interpreted according to the driver. See
- * h5_fileaccess() for details.
+ * h5_get_vfd_fapl() for details.
+ *
+ * HDF5_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.
*
* HDF5_PREFIX: A string to add to the beginning of all serial test
* file names. This can be used to run tests in a
@@ -792,8 +801,8 @@ h5_rmprefix(const char *filename)
* Function: h5_fileaccess
*
* Purpose: Returns a file access template which is the default template
- * but with a file driver set according to the constant or
- * environment variable HDF5_DRIVER
+ * but with a file driver, VOL connector, or libver bound set
+ * according to a constant or environment variable
*
* Return: Success: A file access property list
* Failure: -1
@@ -806,135 +815,34 @@ h5_rmprefix(const char *filename)
hid_t
h5_fileaccess(void)
{
- const char *val = NULL;
- const char *name;
- char s[1024];
hid_t fapl = -1;
- /* First use the environment variable, then the constant */
- val = HDgetenv("HDF5_DRIVER");
-#ifdef HDF5_DRIVER
- if(!val)
- val = HDF5_DRIVER;
-#endif
-
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
return -1;
- if(!val || !*val)
- return fapl; /* use default */
-
- HDstrncpy(s, val, sizeof s);
- s[sizeof(s)-1] = '\0';
- if(NULL == (name = HDstrtok(s, " \t\n\r")))
- return fapl;
-
- if(!HDstrcmp(name, "sec2")) {
- /* Unix read() and write() system calls */
- if (H5Pset_fapl_sec2(fapl) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "stdio")) {
- /* Standard C fread() and fwrite() system calls */
- if (H5Pset_fapl_stdio(fapl) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "core")) {
- /* In-memory driver settings (backing store on, 1 MB increment) */
- if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "core_paged")) {
- /* In-memory driver with write tracking and paging on */
- if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0)
- return -1;
- if(H5Pset_core_write_tracking(fapl, TRUE, (size_t)4096) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "split")) {
- /* Split meta data and raw data each using default driver */
- if(H5Pset_fapl_split(fapl,
- "-m.h5", H5P_DEFAULT,
- "-r.h5", H5P_DEFAULT) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "multi")) {
- /* Multi-file driver, general case of the split driver */
- H5FD_mem_t memb_map[H5FD_MEM_NTYPES];
- hid_t memb_fapl[H5FD_MEM_NTYPES];
- const char *memb_name[H5FD_MEM_NTYPES];
- char *sv[H5FD_MEM_NTYPES];
- haddr_t memb_addr[H5FD_MEM_NTYPES];
- H5FD_mem_t mt;
-
- HDmemset(memb_map, 0, sizeof memb_map);
- HDmemset(memb_fapl, 0, sizeof memb_fapl);
- HDmemset(memb_name, 0, sizeof memb_name);
- HDmemset(memb_addr, 0, sizeof memb_addr);
- HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES);
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) {
- memb_fapl[mt] = H5P_DEFAULT;
- if(NULL == (sv[mt] = (char *)HDmalloc(H5TEST_MULTI_FILENAME_LEN)))
- return -1;
- HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
- memb_name[mt] = sv[mt];
- memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10);
- } /* end for */
+ /* Attempt to set up a file driver first */
+ if(h5_get_vfd_fapl(fapl) < 0)
+ return -1;
- if(H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, FALSE) < 0)
- return -1;
-
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt))
- HDfree(sv[mt]);
- }
- else if(!HDstrcmp(name, "family")) {
- hsize_t fam_size = 100*1024*1024; /*100 MB*/
-
- /* Family of files, each 1MB and using the default driver */
- if((val = HDstrtok(NULL, " \t\n\r")))
- fam_size = (hsize_t)(HDstrtod(val, NULL) * 1024*1024);
- if(H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT)<0)
- return -1;
- }
- else if(!HDstrcmp(name, "log")) {
- unsigned log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC;
-
- /* Log file access */
- if((val = HDstrtok(NULL, " \t\n\r")))
- log_flags = (unsigned)HDstrtol(val, NULL, 0);
- if(H5Pset_fapl_log(fapl, NULL, log_flags, (size_t)0) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "direct")) {
-#ifdef H5_HAVE_DIRECT
- /* Linux direct read() and write() system calls. Set memory boundary, file block size,
- * and copy buffer size to the default values. */
- if(H5Pset_fapl_direct(fapl, 1024, 4096, 8 * 4096) < 0)
- return -1;
-#endif
- }
- else if(!HDstrcmp(name, "latest")) {
- /* use the latest format */
- if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- return -1;
- }
- else {
- /* Unknown driver */
+ /* Next, try to set up a VOL connector */
+ if(h5_get_vol_fapl(fapl) < 0)
return -1;
- }
-
- return fapl;
-}
+
+ /* Finally, check for libver bounds */
+ if(h5_get_libver_fapl(fapl) < 0)
+ return -1;
+
+ return(fapl);
+} /* end h5_fileaccess() */
/*-------------------------------------------------------------------------
* Function: h5_get_vfd_fapl
*
- * Purpose: Returns a file access property list which is the default
- * fapl but with a file driver set according to the constant or
- * environment variable HDF5_DRIVER.
+ * Purpose: Sets the file driver for a FAPL according to the value specified
+ * in the constant or environment variable "HDF5_DRIVER".
*
- * Return: Success: A file access property list ID
+ * Return: Success: 0
* Failure: -1
*
* Programmer: Dana Robinson
@@ -942,60 +850,58 @@ h5_fileaccess(void)
*
*-------------------------------------------------------------------------
*/
-hid_t
-h5_get_vfd_fapl(void)
+herr_t
+h5_get_vfd_fapl(hid_t fapl)
{
const char *env = NULL; /* HDF5_DRIVER environment variable */
const char *tok = NULL; /* strtok pointer */
char buf[1024]; /* buffer for tokenizing HDF5_DRIVER */
- hid_t fapl = -1; /* fapl to be returned */
/* Get the environment variable, if it exists */
env = HDgetenv("HDF5_DRIVER");
-
- /* Create a default fapl */
- if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- return -1;
+#ifdef HDF5_DRIVER
+ /* Use the environment variable, then the compile-time constant */
+ if(!env)
+ env = HDF5_DRIVER;
+#endif
/* If the environment variable was not set, just return
- * the default fapl.
+ * without modifying the FAPL.
*/
if(!env || !*env)
- return fapl;
+ goto done;
/* Get the first 'word' of the environment variable.
* If it's nothing (environment variable was whitespace)
* just return the default fapl.
*/
HDstrncpy(buf, env, sizeof(buf));
- HDmemset(buf, 0, sizeof(buf));
+ buf[sizeof(buf) - 1] = '\0';
if(NULL == (tok = HDstrtok(buf, " \t\n\r")))
- return fapl;
+ goto done;
if(!HDstrcmp(tok, "sec2")) {
/* POSIX (section 2) read() and write() system calls */
if(H5Pset_fapl_sec2(fapl) < 0)
- return -1;
+ goto error;
} else if(!HDstrcmp(tok, "stdio")) {
/* Standard C fread() and fwrite() system calls */
if(H5Pset_fapl_stdio(fapl) < 0)
- return -1;
+ goto error;
} else if(!HDstrcmp(tok, "core")) {
/* In-memory driver settings (backing store on, 1 MB increment) */
if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0)
- return -1;
+ goto error;
} else if(!HDstrcmp(tok, "core_paged")) {
/* In-memory driver with write tracking and paging on */
if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0)
- return -1;
+ goto error;
if(H5Pset_core_write_tracking(fapl, TRUE, (size_t)4096) < 0)
- return -1;
+ goto error;
} else if(!HDstrcmp(tok, "split")) {
/* Split meta data and raw data each using default driver */
- if(H5Pset_fapl_split(fapl,
- "-m.h5", H5P_DEFAULT,
- "-r.h5", H5P_DEFAULT) < 0)
- return -1;
+ if(H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0)
+ goto error;
} else if(!HDstrcmp(tok, "multi")) {
/* Multi-file driver, general case of the split driver */
H5FD_mem_t memb_map[H5FD_MEM_NTYPES];
@@ -1021,19 +927,19 @@ h5_get_vfd_fapl(void)
} /* end for */
if(H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, FALSE) < 0)
- return -1;
+ goto error;
for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt))
HDfree(sv[mt]);
} else if(!HDstrcmp(tok, "family")) {
/* Family of files, each 1MB and using the default driver */
- hsize_t fam_size = 100*1024*1024; /*100 MB*/
+ hsize_t fam_size = 100 * 1024 * 1024; /* 100 MB */
/* Was a family size specified in the environment variable? */
if((tok = HDstrtok(NULL, " \t\n\r")))
- fam_size = (hsize_t)(HDstrtod(tok, NULL) * 1024*1024);
+ fam_size = (hsize_t)(HDstrtod(tok, NULL) * 1024 * 1024);
if(H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT) < 0)
- return -1;
+ goto error;
} else if(!HDstrcmp(tok, "log")) {
/* Log file access */
unsigned log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC;
@@ -1043,25 +949,194 @@ h5_get_vfd_fapl(void)
log_flags = (unsigned)HDstrtol(tok, NULL, 0);
if(H5Pset_fapl_log(fapl, NULL, log_flags, (size_t)0) < 0)
- return -1;
+ goto error;
#ifdef H5_HAVE_DIRECT
} else if(!HDstrcmp(tok, "direct")) {
/* Linux direct read() and write() system calls. Set memory boundary,
* file block size, and copy buffer size to the default values.
*/
- if(H5Pset_fapl_direct(fapl, 1024, 4096, 8*4096)<0)
- return -1;
+ if(H5Pset_fapl_direct(fapl, 1024, 4096, 8 * 4096) < 0)
+ goto error;
#endif
} else {
/* Unknown driver */
- return -1;
+ goto error;
} /* end if */
- return fapl;
+done:
+ return 0;
+
+error:
+ return -1;
} /* end h5_get_vfd_fapl() */
/*-------------------------------------------------------------------------
+ * Function: h5_get_libver_fapl
+ *
+ * Purpose: Sets the library version bounds for a FAPL according to the
+ * value in the constant or environment variable "HDF5_LIBVER_BOUNDS".
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Quincey Koziol
+ * November 2018
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+h5_get_libver_fapl(hid_t fapl)
+{
+ const char *env = NULL; /* HDF5_DRIVER environment variable */
+ const char *tok = NULL; /* strtok pointer */
+ char buf[1024]; /* buffer for tokenizing HDF5_DRIVER */
+
+ /* Get the environment variable, if it exists */
+ env = HDgetenv("HDF5_LIBVER_BOUNDS");
+#ifdef HDF5_LIBVER_BOUNDS
+ /* Use the environment variable, then the compile-time constant */
+ if(!env)
+ env = HDF5_LIBVER_BOUNDS;
+#endif
+
+ /* If the environment variable was not set, just return
+ * without modifying the FAPL.
+ */
+ if(!env || !*env)
+ goto done;
+
+ /* Get the first 'word' of the environment variable.
+ * If it's nothing (environment variable was whitespace)
+ * just return the default fapl.
+ */
+ HDstrncpy(buf, env, sizeof(buf));
+ buf[sizeof(buf) - 1] = '\0';
+ if(NULL == (tok = HDstrtok(buf, " \t\n\r")))
+ goto done;
+
+ if(!HDstrcmp(tok, "latest")) {
+ /* use the latest format */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ goto error;
+ } /* end if */
+ else {
+ /* Unknown setting */
+ goto error;
+ } /* end else */
+
+done:
+ return 0;
+
+error:
+ return -1;
+} /* end h5_get_libver_fapl() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: h5_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: A file access property list ID
+ * Failure: -1
+ *
+ * Programmer: Jordan Henderson
+ * November 2018
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+h5_get_vol_fapl(hid_t fapl)
+{
+ const char *env = NULL;
+ const char *tok = NULL;
+ 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(buf, " \t\n\r")))
+ 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(NULL, " \t\n\r")))
+ 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.
@@ -1908,14 +1983,14 @@ error:
* Purpose: Returns a disposable, generally non-functional,
* VOL class struct.
*
- * In some of the test code, we need a disposable VOL driver
+ * In some of the test code, we need a disposable VOL connector
* but we don't want to mess with the real VFDs and we also
- * don't have access to the internals of the real VOL drivers
+ * don't have access to the internals of the real VOL connectors
* (which use static globals and functions) to easily duplicate
- * them (e.g.: for testing VOL driver ID handling).
+ * them (e.g.: for testing VOL connector ID handling).
*
* This API call will return a pointer to a VOL class that
- * can be used to construct a test VOL using H5VLregister_driver().
+ * can be used to construct a test VOL using H5VLregister_connector().
*
* Return: Success: A pointer to a VOL class struct
* Failure: NULL
@@ -1931,7 +2006,7 @@ h5_get_dummy_vol_class(void)
if(NULL == (vol_class = (H5VL_class_t *)HDcalloc((size_t)1, sizeof(H5VL_class_t))))
TEST_ERROR;
- /* Fill in the minimum parameters to make a VOL driver class that
+ /* Fill in the minimum parameters to make a VOL connector class that
* can be registered.
*/
vol_class->name = "dummy";
diff --git a/test/h5test.h b/test/h5test.h
index 2fb0e0c..c72f389 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -144,12 +144,10 @@ H5TEST_DLL herr_t h5_verify_cached_stabs(const char *base_name[], hid_t fapl);
H5TEST_DLL H5FD_class_t *h5_get_dummy_vfd_class(void);
H5TEST_DLL H5VL_class_t *h5_get_dummy_vol_class(void);
-/* Functions that will replace VFD-dependent functions that violate
- * the single responsibility principle. Unlike their predecessors,
- * these new functions do not have hidden side effects.
- */
-/* h5_fileaccess() replacement */
-H5TEST_DLL hid_t h5_get_vfd_fapl(void);
+/* Functions that will replace components of a FAPL */
+H5TEST_DLL herr_t h5_get_vfd_fapl(hid_t fapl_id);
+H5TEST_DLL herr_t h5_get_vol_fapl(hid_t fapl_id);
+H5TEST_DLL herr_t h5_get_libver_fapl(hid_t fapl_id);
/* h5_clean_files() replacements */
H5TEST_DLL void h5_delete_test_file(const char *base_name, hid_t fapl);
diff --git a/test/links_env.c b/test/links_env.c
index b32fb32..0cd690a 100644
--- a/test/links_env.c
+++ b/test/links_env.c
@@ -148,11 +148,6 @@ main(void)
{
hid_t fapl; /* File access property lists */
int nerrors = 0; /* Error from tests */
- const char *env_h5_drvr; /* File Driver value from environment */
-
- env_h5_drvr = HDgetenv("HDF5_DRIVER");
- if(env_h5_drvr == NULL)
- env_h5_drvr = "nomatch";
h5_reset();
fapl = h5_fileaccess();
diff --git a/test/objcopy.c b/test/objcopy.c
index f13537e..6ee2f72 100644
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -2151,7 +2151,7 @@ test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src)
buf[i][j] = 10000 + 100*i+j;
/* Create a file access property list for destination file */
- if ((fapl_dst = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR
+ if ((fapl_dst = h5_fileaccess()) < 0) TEST_ERROR
/* Initialize the filenames */
h5_fixname(FILENAME[4], fapl_src, src_fname, sizeof src_fname);
@@ -7854,6 +7854,7 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open)
{
hid_t fid_src = -1, fid_dst = -1; /* File IDs */
hid_t did = -1, did2 = -1; /* Dataset IDs */
+ hid_t src_fapl = -1; /* Source file FAPL ID */
const char *src_filename = H5_get_srcdir_filename(FILE_OLD_LAYOUT); /* Corrected test file name */
char dst_filename[NAME_BUF_SIZE];
@@ -7869,8 +7870,14 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open)
/* Reset file address checking info */
addr_reset();
+ /* Setup */
+ if((src_fapl = h5_fileaccess()) < 0) TEST_ERROR
+
/* open source file (read-only) */
- if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR
+
+ /* Close source FAPL */
+ if(H5Pclose(src_fapl) < 0) TEST_ERROR
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR
@@ -7914,6 +7921,7 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open)
error:
H5E_BEGIN_TRY {
+ H5Pclose(src_fapl);
H5Dclose(did2);
H5Dclose(did);
H5Fclose(fid_dst);
diff --git a/test/ohdr.c b/test/ohdr.c
index 2b57ada..cca7e7e 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -486,7 +486,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
FAIL_STACK_ERROR
/* Open FILE_BOGUS */
- if((fid_bogus = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
+ if((fid_bogus = H5Fopen(testfile, H5F_ACC_RDONLY, fapl)) < 0)
FAIL_STACK_ERROR
/* Set up location ID depending on bogus_id */
diff --git a/test/swmr.c b/test/swmr.c
index 3b2af4e..bab91bd 100644
--- a/test/swmr.c
+++ b/test/swmr.c
@@ -6500,10 +6500,9 @@ test_refresh_concur(hid_t in_fapl, hbool_t new_format)
HDexit(EXIT_FAILURE);
/* Wait for notification from parent process */
- while(child_notify != 1) {
+ while(child_notify != 1)
if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0)
HDexit(EXIT_FAILURE);
- }
/* Open the file 2 times */
if((child_fid1 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0)
@@ -6540,10 +6539,9 @@ test_refresh_concur(hid_t in_fapl, hbool_t new_format)
HDexit(EXIT_FAILURE);
/* Wait for notification from parent process */
- while(child_notify != 3) {
+ while(child_notify != 3)
if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0)
HDexit(EXIT_FAILURE);
- }
/* Refresh dataset via did1 */
if(H5Drefresh(child_did1) < 0)
diff --git a/test/testfiles/error_test_1 b/test/testfiles/error_test_1
index 473c53e..f0e4a62 100644
--- a/test/testfiles/error_test_1
+++ b/test/testfiles/error_test_1
@@ -41,25 +41,28 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Dread(): can't read data
major: Dataset
minor: Read failed
- #001: (file name) line (number) in H5VL_dataset_read(): read failed
+ #001: (file name) line (number) in H5VL_dataset_read(): dataset read failed
major: Virtual Object Layer
minor: Read failed
- #002: (file name) line (number) in H5VL_native_dataset_read(): can't read data
+ #002: (file name) line (number) in H5VL__dataset_read(): dataset read failed
+ major: Virtual Object Layer
+ minor: Read failed
+ #003: (file name) line (number) in H5VL__native_dataset_read(): can't read data
major: Dataset
minor: Read failed
- #003: (file name) line (number) in H5D__read(): can't read data
+ #004: (file name) line (number) in H5D__read(): can't read data
major: Dataset
minor: Read failed
- #004: (file name) line (number) in H5D__chunk_read(): unable to read raw data chunk
+ #005: (file name) line (number) in H5D__chunk_read(): unable to read raw data chunk
major: Low-level I/O
minor: Read failed
- #005: (file name) line (number) in H5D__chunk_lock(): data pipeline read failed
+ #006: (file name) line (number) in H5D__chunk_lock(): data pipeline read failed
major: Dataset
minor: Filter operation failed
- #006: (file name) line (number) in H5Z_pipeline(): required filter 'bogus' is not registered
+ #007: (file name) line (number) in H5Z_pipeline(): required filter 'bogus' is not registered
major: Data filters
minor: Read failed
- #007: (file name) line (number) in H5PL_load(): filter plugins disabled
+ #008: (file name) line (number) in H5PL_load(): filter plugins disabled
major: Plugin for dynamically loaded library
minor: Unable to load metadata into cache
diff --git a/test/tfile.c b/test/tfile.c
index 12a0eca..e342da0 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -1600,6 +1600,7 @@ test_file_is_accessible(void)
{
hid_t fid; /* File opened with read-write permission */
hid_t fcpl_id; /* File creation property list */
+ hid_t fapl = -1; /* File access property list */
int fd; /* POSIX file descriptor */
ssize_t nbytes; /* Number of bytes written */
unsigned u; /* Local index variable */
@@ -1610,8 +1611,12 @@ test_file_is_accessible(void)
/* Output message about test being performed */
MESSAGE(5, ("Testing Detection of HDF5 Files\n"));
+ /* Get FAPL */
+ fapl = h5_fileaccess();
+ CHECK(fapl, FAIL, "H5Pcreate");
+
/* Create a file */
- fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
CHECK(fid, FAIL, "H5Fcreate");
/* Close file */
@@ -1619,7 +1624,7 @@ test_file_is_accessible(void)
CHECK(ret, FAIL, "H5Fclose");
/* Verify that the file is an HDF5 file */
- status = H5Fis_accessible(FILE1, H5P_DEFAULT);
+ status = H5Fis_accessible(FILE1, fapl);
VERIFY(status, TRUE, "H5Fis_accessible");
@@ -1631,7 +1636,7 @@ test_file_is_accessible(void)
CHECK(ret, FAIL, "H5Pset_userblock");
/* Create file with non-default user block */
- fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
+ fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl_id, fapl);
CHECK(fid, FAIL, "H5Fcreate");
/* Release file-creation property list */
@@ -1643,7 +1648,7 @@ test_file_is_accessible(void)
CHECK(ret, FAIL, "H5Fclose");
/* Verify that the file is an HDF5 file */
- status = H5Fis_accessible(FILE1, H5P_DEFAULT);
+ status = H5Fis_accessible(FILE1, fapl);
VERIFY(status, TRUE, "H5Fis_accessible");
@@ -1664,9 +1669,13 @@ test_file_is_accessible(void)
CHECK(ret, FAIL, "HDclose");
/* Verify that the file is not an HDF5 file */
- status = H5Fis_accessible(FILE1, H5P_DEFAULT);
+ status = H5Fis_accessible(FILE1, fapl);
VERIFY(status, FALSE, "H5Fis_accessible");
+ /* Close property list */
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
} /* end test_file_is_accessible() */
@@ -1683,6 +1692,7 @@ test_file_ishdf5(void)
{
hid_t file; /* File opened with read-write permission */
hid_t fcpl; /* File creation property list */
+ hid_t fapl = -1; /* File access property list */
int fd; /* File Descriptor */
ssize_t nbytes; /* Number of bytes written */
unsigned u; /* Local index variable */
@@ -1693,8 +1703,12 @@ test_file_ishdf5(void)
/* Output message about test being performed */
MESSAGE(5, ("Testing Detection of HDF5 Files (using deprecated H5Fis_hdf5() call)\n"));
+ /* Get FAPL */
+ fapl = h5_fileaccess();
+ CHECK(fapl, FAIL, "H5Pcreate");
+
/* Create a file */
- file = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ file = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
CHECK(file, FAIL, "H5Fcreate");
/* Close file */
@@ -1714,7 +1728,7 @@ test_file_ishdf5(void)
CHECK(ret, FAIL, "H5Pset_userblock");
/* Create file with non-default user block */
- file = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT);
+ file = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl);
CHECK(file, FAIL, "H5Fcreate");
/* Release file-creation property list */
@@ -1750,6 +1764,10 @@ test_file_ishdf5(void)
status = H5Fis_hdf5(FILE1);
VERIFY(status, FALSE, "H5Fis_hdf5");
+ /* Close property list */
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
} /* end test_file_ishdf5() */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
@@ -2240,10 +2258,8 @@ test_file_double_file_dataset_open(hbool_t new_format)
MESSAGE(5, ("Testing double file and dataset open/close\n"));
/* Setting up test file */
-
- fapl = H5Pcreate(H5P_FILE_ACCESS);
+ fapl = h5_fileaccess();
CHECK(fapl, FAIL, "H5Pcreate");
-
if(new_format) {
ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
CHECK(ret, FAIL, "H5Pset_libver_bounds");
@@ -4165,10 +4181,7 @@ test_file_freespace(const char *env_h5_drvr)
/* Check that there is the right amount of free space in the file */
free_space = H5Fget_freespace(file);
CHECK(free_space, FAIL, "H5Fget_freespace");
- if(new_format)
- VERIFY(free_space, expected_fs_del, "H5Fget_freespace");
- else
- VERIFY(free_space, expected_fs_del, "H5Fget_freespace");
+ VERIFY(free_space, expected_fs_del, "H5Fget_freespace");
/* Close file */
ret = H5Fclose(file);
diff --git a/test/tmisc.c b/test/tmisc.c
index 2a977bf..fef94dd 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -3481,15 +3481,15 @@ test_misc19(void)
HDfree(vfd_cls);
-/* Check H5I operations on virtual object drivers */
+/* Check H5I operations on virtual object connectors */
/* Get a VOL class to register */
vol_cls = h5_get_dummy_vol_class();
CHECK(vol_cls, NULL, "h5_get_dummy_vol_class");
- /* Register a VOL driver */
- volid = H5VLregister_driver(vol_cls);
- CHECK(volid, FAIL, "H5VLregister_driver");
+ /* Register a VOL connector */
+ volid = H5VLregister_connector(vol_cls, H5P_DEFAULT);
+ CHECK(volid, FAIL, "H5VLregister_connector");
/* Check the reference count */
rc = H5Iget_ref(volid);
@@ -3499,23 +3499,23 @@ test_misc19(void)
rc = H5Iinc_ref(volid);
VERIFY(rc, 2, "H5Iinc_ref");
- /* Unregister the VOL driver normally */
- ret = H5VLunregister_driver(volid);
- CHECK(ret, FAIL, "H5VLunregister_driver");
+ /* Unregister the VOL connector normally */
+ ret = H5VLunregister_connector(volid);
+ CHECK(ret, FAIL, "H5VLunregister_connector");
/* Check the reference count */
rc = H5Iget_ref(volid);
VERIFY(rc, 1, "H5Iget_ref");
- /* Unregister the VOL driver by decrementing the reference count */
+ /* Unregister the VOL connector by decrementing the reference count */
rc = H5Idec_ref(volid);
VERIFY(rc, 0, "H5Idec_ref");
- /* Try unregistering the VOL driver again (should fail) */
+ /* Try unregistering the VOL connector again (should fail) */
H5E_BEGIN_TRY {
- ret = H5VLunregister_driver(volid);
+ ret = H5VLunregister_connector(volid);
} H5E_END_TRY;
- VERIFY(ret, FAIL, "H5VLunregister_driver");
+ VERIFY(ret, FAIL, "H5VLunregister_connector");
HDfree(vol_cls);
diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c
index e04ddf3..56d87ee 100644
--- a/test/ttsafe_error.c
+++ b/test/ttsafe_error.c
@@ -74,28 +74,31 @@ tts_error(void)
expected_g[0].min_num = H5E_CANTINIT;
expected_g[1].maj_num = H5E_VOL;
- expected_g[1].min_num = H5E_CANTINIT;
+ expected_g[1].min_num = H5E_CANTCREATE;
- expected_g[2].maj_num = H5E_DATASET;
- expected_g[2].min_num = H5E_CANTINIT;
+ expected_g[2].maj_num = H5E_VOL;
+ expected_g[2].min_num = H5E_CANTCREATE;
expected_g[3].maj_num = H5E_DATASET;
expected_g[3].min_num = H5E_CANTINIT;
- expected_g[4].maj_num = H5E_LINK;
+ expected_g[4].maj_num = H5E_DATASET;
expected_g[4].min_num = H5E_CANTINIT;
expected_g[5].maj_num = H5E_LINK;
- expected_g[5].min_num = H5E_CANTINSERT;
+ expected_g[5].min_num = H5E_CANTINIT;
- expected_g[6].maj_num = H5E_SYM;
- expected_g[6].min_num = H5E_NOTFOUND;
+ expected_g[6].maj_num = H5E_LINK;
+ expected_g[6].min_num = H5E_CANTINSERT;
expected_g[7].maj_num = H5E_SYM;
- expected_g[7].min_num = H5E_CALLBACK;
+ expected_g[7].min_num = H5E_NOTFOUND;
- expected_g[8].maj_num = H5E_LINK;
- expected_g[8].min_num = H5E_EXISTS;
+ expected_g[8].maj_num = H5E_SYM;
+ expected_g[8].min_num = H5E_CALLBACK;
+
+ expected_g[9].maj_num = H5E_LINK;
+ expected_g[9].min_num = H5E_EXISTS;
/* set up mutex for global count of errors */
H5TS_mutex_init(&error_mutex_g);
@@ -121,7 +124,7 @@ tts_error(void)
H5TS_wait_for_thread(threads[i]);
if (error_flag_g) {
- TestErrPrintf("At least one thread reported a value that was different from the exected value\n");
+ 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");
}
diff --git a/test/vds_swmr_gen.c b/test/vds_swmr_gen.c
index 24c6131..1cb9744 100644
--- a/test/vds_swmr_gen.c
+++ b/test/vds_swmr_gen.c
@@ -61,7 +61,7 @@ main(void)
map_start = 0;
/* All SWMR files need to use the latest file format */
- if((faplid = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ if((faplid = h5_fileaccess()) < 0)
TEST_ERROR
if(H5Pset_libver_bounds(faplid, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
TEST_ERROR
diff --git a/test/vds_swmr_reader.c b/test/vds_swmr_reader.c
index 16f3abe..d0ec77b 100644
--- a/test/vds_swmr_reader.c
+++ b/test/vds_swmr_reader.c
@@ -18,6 +18,7 @@ int
main(void)
{
hid_t fid = -1; /* HDF5 file ID */
+ hid_t faplid = -1; /* file access property list ID */
hid_t did = -1; /* dataset ID */
hid_t msid = -1; /* memory dataspace ID */
hid_t fsid = -1; /* file dataspace ID */
@@ -34,7 +35,9 @@ main(void)
/* Open the VDS file and dataset */
- if((fid = H5Fopen(VDS_FILE_NAME, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, H5P_DEFAULT)) < 0)
+ if((faplid = h5_fileaccess()) < 0)
+ TEST_ERROR
+ if((fid = H5Fopen(VDS_FILE_NAME, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, faplid)) < 0)
TEST_ERROR
if((did = H5Dopen2(fid, VDS_DSET_NAME, H5P_DEFAULT)) < 0)
TEST_ERROR
@@ -103,6 +106,8 @@ main(void)
} while (dims[0] < N_PLANES_TO_WRITE);
/* Close file and dataset */
+ if(H5Pclose(faplid) < 0)
+ TEST_ERROR
if(H5Sclose(msid) < 0)
TEST_ERROR
if(H5Dclose(did) < 0)
@@ -120,6 +125,8 @@ error:
H5E_BEGIN_TRY {
if(fid >= 0)
(void)H5Fclose(fid);
+ if(faplid >= 0)
+ (void)H5Pclose(faplid);
if(did >= 0)
(void)H5Dclose(did);
if(msid >= 0)
diff --git a/test/vds_swmr_writer.c b/test/vds_swmr_writer.c
index 7824aa0..d62ecaf 100644
--- a/test/vds_swmr_writer.c
+++ b/test/vds_swmr_writer.c
@@ -56,7 +56,7 @@ main(int argc, char *argv[])
/* Open the source file and dataset */
/* All SWMR files need to use the latest file format */
- if((faplid = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ if((faplid = h5_fileaccess()) < 0)
TEST_ERROR
if(H5Pset_libver_bounds(faplid, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
TEST_ERROR
diff --git a/test/vol.c b/test/vol.c
index 0ef84c5..b70c0ca 100644
--- a/test/vol.c
+++ b/test/vol.c
@@ -19,7 +19,6 @@
*/
#include "h5test.h"
-#include "H5VLnative_private.h"
#define NATIVE_VOL_TEST_FILENAME "native_vol_test"
@@ -41,13 +40,21 @@
*/
static const H5VL_class_t fake_vol_g = {
0, /* version */
- (H5VL_class_value_t)999, /* value */
+ (H5VL_class_value_t)501, /* value */
FAKE_VOL_NAME, /* name */
+ 0, /* capability flags */
NULL, /* initialize */
NULL, /* terminate */
- (size_t)0, /* fapl size */
- NULL, /* fapl copy */
- NULL, /* fapl free */
+ (size_t)0, /* info size */
+ NULL, /* info copy */
+ NULL, /* info compare */
+ NULL, /* info free */
+ NULL, /* info to str */
+ NULL, /* str to info */
+ NULL, /* get_object */
+ NULL, /* get_wrap_ctx */
+ NULL, /* wrap_object */
+ NULL, /* free_wrap_ctx */
{ /* attribute_cls */
NULL, /* create */
NULL, /* open */
@@ -107,10 +114,13 @@ static const H5VL_class_t fake_vol_g = {
NULL, /* specific */
NULL /* optional */
},
- { /* async_cls */
+ { /* request_cls */
+ NULL, /* wait */
+ NULL, /* notify */
NULL, /* cancel */
- NULL, /* test */
- NULL /* wait */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* free */
},
NULL /* optional */
};
@@ -120,7 +130,7 @@ static const H5VL_class_t fake_vol_g = {
* Function: test_vol_registration()
*
* Purpose: Tests if we can load, register, and close a simple
- * VOL driver.
+ * VOL connector.
*
* Return: SUCCEED/FAIL
*
@@ -130,28 +140,48 @@ static herr_t
test_vol_registration(void)
{
htri_t is_registered;
- hid_t vol_id = -1;
+ hid_t vol_id = -1, vol_id2 = -1;
TESTING("VOL registration");
- /* The test/fake VOL driver should not be registered at the start of the test */
- if ((is_registered = H5VLis_driver_registered(FAKE_VOL_NAME)) < 0)
+ /* The test/fake VOL connector should not be registered at the start of the test */
+ if ((is_registered = H5VLis_connector_registered(FAKE_VOL_NAME)) < 0)
FAIL_STACK_ERROR;
if (is_registered > 0)
- FAIL_PUTS_ERROR("native VOL driver is inappropriately registered");
+ FAIL_PUTS_ERROR("native VOL connector is inappropriately registered");
/* Load a VOL interface */
- if ((vol_id = H5VLregister_driver(&fake_vol_g)) < 0)
+ if ((vol_id = H5VLregister_connector(&fake_vol_g, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR;
- /* The test/fake VOL driver should be registered now */
- if ((is_registered = H5VLis_driver_registered(FAKE_VOL_NAME)) < 0)
+ /* The test/fake VOL connector should be registered now */
+ if ((is_registered = H5VLis_connector_registered(FAKE_VOL_NAME)) < 0)
FAIL_STACK_ERROR;
if (0 == is_registered)
- FAIL_PUTS_ERROR("native VOL driver is un-registered");
+ FAIL_PUTS_ERROR("native VOL connector is un-registered");
- /* Close the VOL interface */
- if (H5VLclose(vol_id) < 0)
+ /* Re-register a VOL connector */
+ if ((vol_id2 = H5VLregister_connector(&fake_vol_g, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR;
+
+ /* The test/fake VOL connector should still be registered now */
+ if ((is_registered = H5VLis_connector_registered(FAKE_VOL_NAME)) < 0)
+ FAIL_STACK_ERROR;
+ if (0 == is_registered)
+ FAIL_PUTS_ERROR("native VOL connector is un-registered");
+
+ /* Unregister the second test/fake VOL ID */
+ if (H5VLunregister_connector(vol_id2) < 0)
+ FAIL_STACK_ERROR;
+
+ /* The test/fake VOL connector should still be registered now */
+ if ((is_registered = H5VLis_connector_registered(FAKE_VOL_NAME)) < 0)
+ FAIL_STACK_ERROR;
+ if (0 == is_registered)
+ FAIL_PUTS_ERROR("native VOL connector is un-registered");
+
+ /* Unregister the original test/fake VOL ID */
+ if (H5VLunregister_connector(vol_id) < 0)
FAIL_STACK_ERROR;
PASSED();
@@ -159,7 +189,7 @@ test_vol_registration(void)
error:
H5E_BEGIN_TRY {
- H5VLclose(vol_id);
+ H5VLunregister_connector(vol_id);
} H5E_END_TRY;
return FAIL;
@@ -169,7 +199,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_native_vol_init()
*
- * Purpose: Tests if the native VOL driver gets initialized.
+ * Purpose: Tests if the native VOL connector gets initialized.
*
* Return: SUCCEED/FAIL
*
@@ -180,13 +210,13 @@ test_native_vol_init(void)
{
htri_t is_registered;
- TESTING("Native VOL driver initialization");
+ TESTING("Native VOL connector initialization");
- /* The native VOL driver should always be registered */
- if ((is_registered = H5VLis_driver_registered(H5VL_NATIVE_NAME)) < 0)
+ /* The native VOL connector should always be registered */
+ if ((is_registered = H5VLis_connector_registered(H5VL_NATIVE_NAME)) < 0)
FAIL_STACK_ERROR;
if (0 == is_registered)
- FAIL_PUTS_ERROR("native VOL driver is un-registered");
+ FAIL_PUTS_ERROR("native VOL connector is un-registered");
PASSED();
return SUCCEED;
@@ -200,7 +230,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_file_operation()
*
- * Purpose: Uses the native VOL driver to test basic VOL file operations
+ * Purpose: Uses the native VOL connector to test basic VOL file operations
*
* Return: SUCCEED/FAIL
*
@@ -212,6 +242,7 @@ test_basic_file_operation(void)
hid_t fid = H5I_INVALID_HID;
hid_t fid_reopen = H5I_INVALID_HID;
hid_t fapl_id = H5I_INVALID_HID;
+ hid_t fapl_id2 = H5I_INVALID_HID;
hid_t fcpl_id = H5I_INVALID_HID;
ssize_t obj_count;
@@ -224,8 +255,25 @@ test_basic_file_operation(void)
TESTING("Basic VOL file operations");
+ /* Retrieve the file access property for testing */
+ fapl_id = h5_fileaccess();
+
+ /* Set the file close degree to a non-default value, to make the H5Pequal
+ * work out. This is kinda odd, but the library's current behavior with
+ * a default value is to return the value chosen (H5F_CLOSE_SEMI) instead
+ * of the default value (H5F_CLOSE_DEFAULT) from the property and then
+ * the H5Pequal doesn't detect that the property lists are the same. Since
+ * this is the documented behavior for file close degree for many years,
+ * I'm not fighting it, just getting the testing to verify that the VOL
+ * connector property is returned correctly. -QAK, 2018/11/17
+ */
+ if(H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI) < 0)
+ TEST_ERROR;
+ if(H5Pset_metadata_read_attempts(fapl_id, 9) < 0)
+ FAIL_STACK_ERROR
+
/* H5Fcreate */
- if ((fid = H5Fcreate(NATIVE_VOL_TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if ((fid = H5Fcreate(NATIVE_VOL_TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
TEST_ERROR;
/* H5Fget_obj_count */
@@ -243,9 +291,11 @@ test_basic_file_operation(void)
TEST_ERROR;
/* H5Fget_access_plist */
- if ((fapl_id = H5Fget_access_plist(fid)) < 0)
+ if ((fapl_id2 = H5Fget_access_plist(fid)) < 0)
TEST_ERROR;
- if (H5Pclose(fapl_id) < 0)
+ if (H5Pequal(fapl_id, fapl_id2) != TRUE)
+ TEST_ERROR;
+ if (H5Pclose(fapl_id2) < 0)
TEST_ERROR;
/* H5Fget_create_plist */
@@ -287,19 +337,41 @@ test_basic_file_operation(void)
TEST_ERROR;
/* H5Fis_accessible */
- if (H5Fis_accessible(NATIVE_VOL_TEST_FILENAME, H5P_DEFAULT) < 0)
+ if (H5Fis_accessible(NATIVE_VOL_TEST_FILENAME, fapl_id) < 0)
TEST_ERROR;
/* H5Fopen */
- if ((fid = H5Fopen(NATIVE_VOL_TEST_FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
+ if ((fid = H5Fopen(NATIVE_VOL_TEST_FILENAME, H5F_ACC_RDWR, fapl_id)) < 0)
+ TEST_ERROR;
+
+ /* H5Fget_access_plist */
+ if ((fapl_id2 = H5Fget_access_plist(fid)) < 0)
TEST_ERROR;
+ if (H5Pequal(fapl_id, fapl_id2) != TRUE)
+ TEST_ERROR;
+ if (H5Pclose(fapl_id2) < 0)
+ TEST_ERROR;
+
if ((fid_reopen = H5Freopen(fid)) < 0)
TEST_ERROR;
+
+ /* H5Fget_access_plist */
+ if ((fapl_id2 = H5Fget_access_plist(fid_reopen)) < 0)
+ TEST_ERROR;
+ if (H5Pequal(fapl_id, fapl_id2) != TRUE)
+ TEST_ERROR;
+ if (H5Pclose(fapl_id2) < 0)
+ TEST_ERROR;
+
if (H5Fclose(fid) < 0)
TEST_ERROR;
if (H5Fclose(fid_reopen) < 0)
TEST_ERROR;
+ /* H5Pclose */
+ if (H5Pclose(fapl_id) < 0)
+ TEST_ERROR;
+
HDremove(NATIVE_VOL_TEST_FILENAME);
PASSED();
@@ -310,6 +382,7 @@ error:
H5Fclose(fid);
H5Fclose(fid_reopen);
H5Pclose(fapl_id);
+ H5Pclose(fapl_id2);
H5Pclose(fcpl_id);
} H5E_END_TRY;
@@ -321,7 +394,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_group_operation()
*
- * Purpose: Uses the native VOL driver to test basic VOL group operations
+ * Purpose: Uses the native VOL connector to test basic VOL group operations
*
* Return: SUCCEED/FAIL
*
@@ -412,7 +485,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_dataset_operation()
*
- * Purpose: Uses the native VOL driver to test basic VOL dataset operations
+ * Purpose: Uses the native VOL connector to test basic VOL dataset operations
*
* Return: SUCCEED/FAIL
*
@@ -581,7 +654,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_attribute_operation()
*
- * Purpose: Uses the native VOL driver to test basic VOL attribute operations
+ * Purpose: Uses the native VOL connector to test basic VOL attribute operations
*
* Return: SUCCEED/FAIL
*
@@ -679,7 +752,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_object_operation()
*
- * Purpose: Uses the native VOL driver to test basic VOL object operations
+ * Purpose: Uses the native VOL connector to test basic VOL object operations
*
* Return: SUCCEED/FAIL
*
@@ -743,7 +816,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_link_operation()
*
- * Purpose: Uses the native VOL driver to test basic VOL link operations
+ * Purpose: Uses the native VOL connector to test basic VOL link operations
*
* Return: SUCCEED/FAIL
*
@@ -808,7 +881,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_datatype_operation()
*
- * Purpose: Uses the native VOL driver to test basic VOL datatype operations
+ * Purpose: Uses the native VOL connector to test basic VOL datatype operations
*
* Return: SUCCEED/FAIL
*
@@ -890,7 +963,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_echo_vol_operation()
*
- * Purpose: Uses the echo VOL driver to test basic VOL operations
+ * Purpose: Uses the echo VOL connector to test basic VOL operations
* via the H5VL public API.
*
* Return: SUCCEED/FAIL