summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/dsets.c15
-rw-r--r--test/dtypes.c16
-rw-r--r--test/file_image.c3
-rw-r--r--test/objcopy.c12
-rw-r--r--test/ohdr.c2
-rw-r--r--test/testfiles/error_test_12
-rw-r--r--test/tfile.c5
-rw-r--r--test/tmisc.c22
-rw-r--r--test/vol.c82
9 files changed, 102 insertions, 57 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/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/testfiles/error_test_1 b/test/testfiles/error_test_1
index 473c53e..7838c9c 100644
--- a/test/testfiles/error_test_1
+++ b/test/testfiles/error_test_1
@@ -44,7 +44,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#001: (file name) line (number) in H5VL_dataset_read(): 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__native_dataset_read(): can't read data
major: Dataset
minor: Read failed
#003: (file name) line (number) in H5D__read(): can't read data
diff --git a/test/tfile.c b/test/tfile.c
index 12a0eca..f7ac243 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -4165,10 +4165,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..02521e4 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 plugins */
/* 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 plugin */
+ volid = H5VLregister_plugin(vol_cls, H5P_DEFAULT);
+ CHECK(volid, FAIL, "H5VLregister_plugin");
/* 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 plugin normally */
+ ret = H5VLunregister_plugin(volid);
+ CHECK(ret, FAIL, "H5VLunregister_plugin");
/* 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 plugin 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 plugin again (should fail) */
H5E_BEGIN_TRY {
- ret = H5VLunregister_driver(volid);
+ ret = H5VLunregister_plugin(volid);
} H5E_END_TRY;
- VERIFY(ret, FAIL, "H5VLunregister_driver");
+ VERIFY(ret, FAIL, "H5VLunregister_plugin");
HDfree(vol_cls);
diff --git a/test/vol.c b/test/vol.c
index 0ef84c5..553a9cf 100644
--- a/test/vol.c
+++ b/test/vol.c
@@ -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 */
@@ -120,7 +126,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 plugin.
*
* Return: SUCCEED/FAIL
*
@@ -130,28 +136,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 plugin should not be registered at the start of the test */
+ if ((is_registered = H5VLis_plugin_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 plugin is inappropriately registered");
/* Load a VOL interface */
- if ((vol_id = H5VLregister_driver(&fake_vol_g)) < 0)
+ if ((vol_id = H5VLregister_plugin(&fake_vol_g)) < 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 plugin should be registered now */
+ if ((is_registered = H5VLis_plugin_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 plugin is un-registered");
- /* Close the VOL interface */
- if (H5VLclose(vol_id) < 0)
+ /* Re-register a VOL plugin */
+ if ((vol_id2 = H5VLregister(&fake_vol_g, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR;
+
+ /* The test/fake VOL plugin should still be registered now */
+ if ((is_registered = H5VLis_registered(FAKE_VOL_NAME)) < 0)
+ FAIL_STACK_ERROR;
+ if (0 == is_registered)
+ FAIL_PUTS_ERROR("native VOL plugin is un-registered");
+
+ /* Unregister the second test/fake VOL ID */
+ if (H5VLunregister(vol_id2) < 0)
+ FAIL_STACK_ERROR;
+
+ /* The test/fake VOL plugin should still be registered now */
+ if ((is_registered = H5VLis_registered(FAKE_VOL_NAME)) < 0)
+ FAIL_STACK_ERROR;
+ if (0 == is_registered)
+ FAIL_PUTS_ERROR("native VOL plugin is un-registered");
+
+ /* Unregister the original test/fake VOL ID */
+ if (H5VLunregister(vol_id) < 0)
FAIL_STACK_ERROR;
PASSED();
@@ -159,7 +185,7 @@ test_vol_registration(void)
error:
H5E_BEGIN_TRY {
- H5VLclose(vol_id);
+ H5VLunregister(vol_id);
} H5E_END_TRY;
return FAIL;
@@ -169,7 +195,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_native_vol_init()
*
- * Purpose: Tests if the native VOL driver gets initialized.
+ * Purpose: Tests if the native VOL plugin gets initialized.
*
* Return: SUCCEED/FAIL
*
@@ -180,13 +206,13 @@ test_native_vol_init(void)
{
htri_t is_registered;
- TESTING("Native VOL driver initialization");
+ TESTING("Native VOL plugin initialization");
- /* The native VOL driver should always be registered */
- if ((is_registered = H5VLis_driver_registered(H5VL_NATIVE_NAME)) < 0)
+ /* The native VOL plugin should always be registered */
+ if ((is_registered = H5VLis_plugin_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 plugin is un-registered");
PASSED();
return SUCCEED;
@@ -200,7 +226,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_file_operation()
*
- * Purpose: Uses the native VOL driver to test basic VOL file operations
+ * Purpose: Uses the native VOL plugin to test basic VOL file operations
*
* Return: SUCCEED/FAIL
*
@@ -321,7 +347,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_group_operation()
*
- * Purpose: Uses the native VOL driver to test basic VOL group operations
+ * Purpose: Uses the native VOL plugin to test basic VOL group operations
*
* Return: SUCCEED/FAIL
*
@@ -412,7 +438,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_dataset_operation()
*
- * Purpose: Uses the native VOL driver to test basic VOL dataset operations
+ * Purpose: Uses the native VOL plugin to test basic VOL dataset operations
*
* Return: SUCCEED/FAIL
*
@@ -581,7 +607,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_attribute_operation()
*
- * Purpose: Uses the native VOL driver to test basic VOL attribute operations
+ * Purpose: Uses the native VOL plugin to test basic VOL attribute operations
*
* Return: SUCCEED/FAIL
*
@@ -679,7 +705,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_object_operation()
*
- * Purpose: Uses the native VOL driver to test basic VOL object operations
+ * Purpose: Uses the native VOL plugin to test basic VOL object operations
*
* Return: SUCCEED/FAIL
*
@@ -743,7 +769,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_link_operation()
*
- * Purpose: Uses the native VOL driver to test basic VOL link operations
+ * Purpose: Uses the native VOL plugin to test basic VOL link operations
*
* Return: SUCCEED/FAIL
*
@@ -808,7 +834,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_datatype_operation()
*
- * Purpose: Uses the native VOL driver to test basic VOL datatype operations
+ * Purpose: Uses the native VOL plugin to test basic VOL datatype operations
*
* Return: SUCCEED/FAIL
*
@@ -890,7 +916,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_echo_vol_operation()
*
- * Purpose: Uses the echo VOL driver to test basic VOL operations
+ * Purpose: Uses the echo VOL plugin to test basic VOL operations
* via the H5VL public API.
*
* Return: SUCCEED/FAIL