diff options
author | jhendersonHDF <jhenderson@hdfgroup.org> | 2023-11-13 19:49:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-13 19:49:38 (GMT) |
commit | 28d2b6771f41396f1e243e00cb9dd57c4c891613 (patch) | |
tree | 238e77e247ac6b688d0eea0a6f81df95e47448dc /test/th5o.c | |
parent | 8b3ffdef3099d2699ec71a5f855966132b3d3c25 (diff) | |
download | hdf5-28d2b6771f41396f1e243e00cb9dd57c4c891613.zip hdf5-28d2b6771f41396f1e243e00cb9dd57c4c891613.tar.gz hdf5-28d2b6771f41396f1e243e00cb9dd57c4c891613.tar.bz2 |
HDF5 API test updates (#3835)
* HDF5 API test updates
Removed test duplication from bringing API tests
back into the library from external VOL tests
repo
Synced changes between API tests and library's
tests
Updated API tests CMake code to directly use and
install testhdf5, testphdf5, etc. instead of
creating duplicate binaries
Added new h5_using_native_vol() test function to
determine whether the VOL connector being used
is (or the VOL connector stack being used resolves
to) the native VOL connector
* Remove duplicate variable
Diffstat (limited to 'test/th5o.c')
-rw-r--r-- | test/th5o.c | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/test/th5o.c b/test/th5o.c index 17cfad7..801091f 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -267,7 +267,8 @@ test_h5o_open_by_addr(void) H5I_type_t id_type; /* Type of IDs returned from H5Oopen */ H5G_info_t ginfo; /* Group info struct */ H5T_class_t type_class; /* Class of the datatype */ - herr_t ret; /* Value returned from API calls */ + bool vol_is_native; + herr_t ret; /* Value returned from API calls */ h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename); @@ -275,6 +276,13 @@ test_h5o_open_by_addr(void) fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(H5P_DEFAULT, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + if (!vol_is_native) { + CHECK(H5Fclose(fid), FAIL, "H5Fclose"); + return; + } + /* Create a group, dataset, and committed datatype within the file */ /* Create the group */ grp = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -1109,6 +1117,7 @@ test_h5o_comment(void) char check_comment[64]; ssize_t comment_len = 0; ssize_t len; + bool vol_is_native; herr_t ret; /* Value returned from API calls */ int ret_value; @@ -1118,6 +1127,13 @@ test_h5o_comment(void) fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(H5P_DEFAULT, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + if (!vol_is_native) { + CHECK(H5Fclose(fid), FAIL, "H5Fclose"); + return; + } + /* Create an attribute for the file */ attr_space = H5Screate_simple(1, &attr_dims, NULL); CHECK(attr_space, FAIL, "H5Screate_simple"); @@ -1284,6 +1300,7 @@ test_h5o_comment_by_name(void) char check_comment[64]; ssize_t comment_len = 0; ssize_t len; + bool vol_is_native; herr_t ret; /* Value returned from API calls */ int ret_value; @@ -1293,6 +1310,13 @@ test_h5o_comment_by_name(void) fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(H5P_DEFAULT, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + if (!vol_is_native) { + CHECK(H5Fclose(fid), FAIL, "H5Fclose"); + return; + } + /* Create an attribute for the file */ attr_space = H5Screate_simple(1, &attr_dims, NULL); CHECK(attr_space, FAIL, "H5Screate_simple"); @@ -1556,7 +1580,8 @@ test_h5o_open_by_addr_deprec(void) H5I_type_t id_type; /* Type of IDs returned from H5Oopen */ H5G_info_t ginfo; /* Group info struct */ H5T_class_t type_class; /* Class of the datatype */ - herr_t ret; /* Value returned from API calls */ + bool vol_is_native; + herr_t ret; /* Value returned from API calls */ h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename); @@ -1564,6 +1589,13 @@ test_h5o_open_by_addr_deprec(void) fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(H5P_DEFAULT, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + if (!vol_is_native) { + CHECK(H5Fclose(fid), FAIL, "H5Fclose"); + return; + } + /* Create a group, dataset, and committed datatype within the file */ /* Create the group */ grp = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -1739,7 +1771,8 @@ test_h5o_getinfo_visit(void) H5O_info1_t oinfo1, oinfo2; /* Object info structs */ char attrname[25]; /* Attribute name */ int j; /* Local index variable */ - herr_t ret; /* Value returned from API calls */ + bool vol_is_native; + herr_t ret; /* Value returned from API calls */ /* Output message about test being performed */ MESSAGE(5, ("Testing info returned by H5Oget_info vs H5Ovisit\n")); @@ -1750,6 +1783,14 @@ test_h5o_getinfo_visit(void) fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fcreate"); + /* Check if native VOL is being used */ + CHECK(h5_using_native_vol(H5P_DEFAULT, fid, &vol_is_native), FAIL, "h5_using_native_vol"); + if (!vol_is_native) { + CHECK(H5Fclose(fid), FAIL, "H5Fclose"); + MESSAGE(5, (" -- SKIPPED --\n")); + return; + } + /* Create "group1" in the file */ gid1 = H5Gcreate2(fid, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(gid1, FAIL, "H5Gcreate2"); |