diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/dsets.c | 15 | ||||
-rw-r--r-- | test/dtypes.c | 16 | ||||
-rw-r--r-- | test/file_image.c | 3 | ||||
-rw-r--r-- | test/h5test.c | 10 | ||||
-rw-r--r-- | test/objcopy.c | 12 | ||||
-rw-r--r-- | test/ohdr.c | 2 | ||||
-rw-r--r-- | test/swmr.c | 6 | ||||
-rw-r--r-- | test/testfiles/error_test_1 | 17 | ||||
-rw-r--r-- | test/tfile.c | 41 | ||||
-rw-r--r-- | test/tmisc.c | 22 | ||||
-rw-r--r-- | test/ttsafe_error.c | 25 | ||||
-rw-r--r-- | test/vds_swmr_gen.c | 2 | ||||
-rw-r--r-- | test/vds_swmr_reader.c | 9 | ||||
-rw-r--r-- | test/vds_swmr_writer.c | 2 | ||||
-rw-r--r-- | test/vol.c | 90 |
15 files changed, 173 insertions, 99 deletions
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/h5test.c b/test/h5test.c index c1cc55b..3c02e4e 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -1908,14 +1908,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 plugin * 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 plugins * (which use static globals and functions) to easily duplicate - * them (e.g.: for testing VOL driver ID handling). + * them (e.g.: for testing VOL plugin 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_plugin(). * * Return: Success: A pointer to a VOL class struct * Failure: NULL @@ -1931,7 +1931,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 plugin class that * can be registered. */ vol_class->name = "dummy"; 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 @@ -43,11 +43,17 @@ static const H5VL_class_t fake_vol_g = { 0, /* version */ (H5VL_class_value_t)999, /* 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, /* get_object */ + NULL, /* get_wrap_ctx */ + NULL, /* free_wrap_ctx */ + NULL, /* wrap_object */ { /* attribute_cls */ NULL, /* create */ NULL, /* open */ @@ -107,10 +113,12 @@ static const H5VL_class_t fake_vol_g = { NULL, /* specific */ NULL /* optional */ }, - { /* async_cls */ + { /* request_cls */ + NULL, /* wait */ NULL, /* cancel */ - NULL, /* test */ - NULL /* wait */ + NULL, /* specific */ + NULL, /* optional */ + NULL /* free */ }, NULL /* optional */ }; @@ -120,7 +128,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 +138,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 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 connector is un-registered"); + + /* 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 driver should be registered now */ - if ((is_registered = H5VLis_driver_registered(FAKE_VOL_NAME)) < 0) + /* 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 driver is un-registered"); + FAIL_PUTS_ERROR("native VOL connector is un-registered"); - /* Close the VOL interface */ - if (H5VLclose(vol_id) < 0) + /* Unregister the original test/fake VOL ID */ + if (H5VLunregister_connector(vol_id) < 0) FAIL_STACK_ERROR; PASSED(); @@ -159,7 +187,7 @@ test_vol_registration(void) error: H5E_BEGIN_TRY { - H5VLclose(vol_id); + H5VLunregister_connector(vol_id); } H5E_END_TRY; return FAIL; @@ -169,7 +197,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 +208,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 +228,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 * @@ -321,7 +349,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 +440,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 +609,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 +707,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 +771,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 +836,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 +918,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 |