diff options
author | jhendersonHDF <jhenderson@hdfgroup.org> | 2023-04-03 18:08:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-03 18:08:39 (GMT) |
commit | f105dcc20a8400e4016fb8b5c572f9c27d65d957 (patch) | |
tree | 1de92826c3165f9772067794374e6fc5b65606c2 /test/tselect.c | |
parent | 1c1af33a126e66640c2c2f100f743bd8b8fc07da (diff) | |
download | hdf5-f105dcc20a8400e4016fb8b5c572f9c27d65d957.zip hdf5-f105dcc20a8400e4016fb8b5c572f9c27d65d957.tar.gz hdf5-f105dcc20a8400e4016fb8b5c572f9c27d65d957.tar.bz2 |
Synchronize HDF5 tests with VOL tests (#2628)
Diffstat (limited to 'test/tselect.c')
-rw-r--r-- | test/tselect.c | 86 |
1 files changed, 71 insertions, 15 deletions
diff --git a/test/tselect.c b/test/tselect.c index 6b63d2b..3dd739c 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -1025,7 +1025,11 @@ test_select_all_hyper(hid_t xfer_plist) CHECK(ret, FAIL, "H5Sselect_none"); /* Read selection from disk (should fail with no selection defined) */ - ret = H5Dread(dataset, H5T_NATIVE_UCHAR, sid2, sid1, xfer_plist, rbuf); + H5E_BEGIN_TRY + { + ret = H5Dread(dataset, H5T_NATIVE_UCHAR, sid2, sid1, xfer_plist, rbuf); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Dread"); /* Select entire 15x26 extent for disk dataset */ @@ -5605,31 +5609,63 @@ test_select_hyper_valid_combination(void) /* Test all the selections created */ /* Test the invalid combinations between point and hyperslab */ - tmp_sid = H5Scombine_select(single_pt_sid, H5S_SELECT_AND, single_hyper_sid); + H5E_BEGIN_TRY + { + tmp_sid = H5Scombine_select(single_pt_sid, H5S_SELECT_AND, single_hyper_sid); + } + H5E_END_TRY; VERIFY(tmp_sid, FAIL, "H5Scombine_select"); - tmp_sid = H5Smodify_select(single_pt_sid, H5S_SELECT_AND, single_hyper_sid); + H5E_BEGIN_TRY + { + tmp_sid = H5Smodify_select(single_pt_sid, H5S_SELECT_AND, single_hyper_sid); + } + H5E_END_TRY; VERIFY(tmp_sid, FAIL, "H5Smodify_select"); /* Test the invalid combination between two hyperslab but of different dimension size */ - tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_AND, regular_hyper_sid); + H5E_BEGIN_TRY + { + tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_AND, regular_hyper_sid); + } + H5E_END_TRY; VERIFY(tmp_sid, FAIL, "H5Scombine_select"); - tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_AND, regular_hyper_sid); + H5E_BEGIN_TRY + { + tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_AND, regular_hyper_sid); + } + H5E_END_TRY; VERIFY(tmp_sid, FAIL, "H5Smodify_select"); /* Test invalid operation inputs to the two functions */ - tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_SET, single_hyper_sid); + H5E_BEGIN_TRY + { + tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_SET, single_hyper_sid); + } + H5E_END_TRY; VERIFY(tmp_sid, FAIL, "H5Scombine_select"); - tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_SET, single_hyper_sid); + H5E_BEGIN_TRY + { + tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_SET, single_hyper_sid); + } + H5E_END_TRY; VERIFY(tmp_sid, FAIL, "H5Smodify_select"); /* Test inputs in case of non-existent space ids */ - tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_AND, non_existent_sid); + H5E_BEGIN_TRY + { + tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_AND, non_existent_sid); + } + H5E_END_TRY; VERIFY(tmp_sid, FAIL, "H5Scombine_select"); - tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_AND, non_existent_sid); + H5E_BEGIN_TRY + { + tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_AND, non_existent_sid); + } + H5E_END_TRY; VERIFY(tmp_sid, FAIL, "H5Smodify_select"); /* Close dataspaces */ @@ -6891,10 +6927,18 @@ test_select_valid(void) MESSAGE(8, ("Case 1 : sub_space is not a valid dataspace\n")); dims[0] = dims[1] = H5S_UNLIMITED; - sub_space = H5Screate_simple(2, dims, NULL); + H5E_BEGIN_TRY + { + sub_space = H5Screate_simple(2, dims, NULL); + } + H5E_END_TRY; VERIFY(sub_space, FAIL, "H5Screate_simple"); - valid = H5Sselect_valid(sub_space); + H5E_BEGIN_TRY + { + valid = H5Sselect_valid(sub_space); + } + H5E_END_TRY; VERIFY(valid, FAIL, "H5Sselect_valid"); /* Set arrays and dataspace for the rest of the cases */ @@ -6911,7 +6955,11 @@ test_select_valid(void) error = H5Sclose(sub_space); CHECK(error, FAIL, "H5Sclose"); - valid = H5Sselect_valid(sub_space); + H5E_BEGIN_TRY + { + valid = H5Sselect_valid(sub_space); + } + H5E_END_TRY; VERIFY(valid, FAIL, "H5Sselect_valid"); MESSAGE(8, ("Case 3 : in the dimensions\nTry offset (4,4) and size(6,6), the original space is of size " @@ -13867,7 +13915,7 @@ test_select_bounds(void) ret = H5Sget_select_bounds(sid, low_bounds, high_bounds); } H5E_END_TRY; - VERIFY(ret, FAIL, "H5Sget_select_bo unds"); + VERIFY(ret, FAIL, "H5Sget_select_bounds"); /* Set point selection */ coord[0][0] = 3; @@ -14650,7 +14698,11 @@ test_hyper_unlim(void) VERIFY(ssize_out, (hssize_t)H5S_UNLIMITED, "H5Sget_select_npoints"); /* Test H5Sget_select_hyper_nblocks() */ - ssize_out = H5Sget_select_hyper_nblocks(sid); + H5E_BEGIN_TRY + { + ssize_out = H5Sget_select_hyper_nblocks(sid); + } + H5E_END_TRY; VERIFY(ssize_out, (hssize_t)H5S_UNLIMITED, "H5Sget_select_hyper_nblocks"); /* Test H5Sget_select_bounds() */ @@ -16211,5 +16263,9 @@ test_select(void) void cleanup_select(void) { - HDremove(FILENAME); + H5E_BEGIN_TRY + { + H5Fdelete(FILENAME, H5P_DEFAULT); + } + H5E_END_TRY; } |