Skip to content

Commit

Permalink
Add check of returned value from API calls. (HDFGroup#4702)
Browse files Browse the repository at this point in the history
These were found while investigating HDFGroupGH-4672, but they were not related
to HDFGroupGH-4672.
  • Loading branch information
bmribler authored and lrknox committed Aug 21, 2024
1 parent 11fb3a4 commit 9e23b2a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/links.c
Original file line number Diff line number Diff line change
Expand Up @@ -9154,7 +9154,8 @@ external_set_elink_fapl1(hid_t fapl, bool new_format)
TEST_ERROR;

/* open target object A */
oidA = H5Oopen(fid, "ext_linkA", lapl_idA);
if ((oidA = H5Oopen(fid, "ext_linkA", lapl_idA)) < 0)
TEST_ERROR;

/* should succeed in opening the target object A in the current working directory */
if (oidA < 0) {
Expand All @@ -9170,7 +9171,8 @@ external_set_elink_fapl1(hid_t fapl, bool new_format)
TEST_ERROR;

/* open target object B */
oidB = H5Oopen(fid, "ext_linkB", lapl_idB);
if ((oidB = H5Oopen(fid, "ext_linkB", lapl_idB)) < 0)
TEST_ERROR;

/* should succeed in opening the target object B in the current working directory */
if (oidB < 0) {
Expand Down Expand Up @@ -10140,7 +10142,8 @@ external_set_elink_cb(hid_t fapl, bool new_format)
if (h5_using_parallel_driver(fapl, &driver_is_parallel) < 0)
TEST_ERROR;

base_driver = H5Pget_driver(fapl);
if ((base_driver = H5Pget_driver(fapl)) < 0)
TEST_ERROR;

/* Core file driver has issues when used as the member file driver for a family file */
/* Family file driver cannot be used with family or multi drivers for member files */
Expand Down Expand Up @@ -13459,7 +13462,8 @@ external_file_cache(hid_t fapl, bool new_format)
H5F_sfile_assert_num(0);

/* Close fapl */
H5Pclose(my_fapl);
if (H5Pclose(my_fapl) < 0)
TEST_ERROR;

PASSED();
return SUCCEED;
Expand Down

0 comments on commit 9e23b2a

Please sign in to comment.