summaryrefslogtreecommitdiffstats
path: root/test/links.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2019-10-04 09:03:11 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2019-10-04 09:03:11 (GMT)
commitff3278f1a0d57663d73caa6aaa7f209864e9a9bd (patch)
treed81ca396769c165241ad1eb0815c3f34d87741f6 /test/links.c
parentf2be6da71479c4d20e61af8dfebd2aa0050427d9 (diff)
downloadhdf5-ff3278f1a0d57663d73caa6aaa7f209864e9a9bd.zip
hdf5-ff3278f1a0d57663d73caa6aaa7f209864e9a9bd.tar.gz
hdf5-ff3278f1a0d57663d73caa6aaa7f209864e9a9bd.tar.bz2
Fixed a bug (HDFFV-10899) where the behavior of the deprecated
H5Gget_objinfo() call had changed and passing in a non-existing soft link with a statbuf of NULL passed instead of failed (as it should as per the RM). The HDF5 1.8 and 1.10 behavior was restored and H5Gget_objinfo() will now fail and return -1 as before.
Diffstat (limited to 'test/links.c')
-rw-r--r--test/links.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/links.c b/test/links.c
index 4eb4126..916ad88 100644
--- a/test/links.c
+++ b/test/links.c
@@ -1576,6 +1576,10 @@ test_deprec(hid_t fapl, hbool_t new_format)
if(H5Gget_linkval(group2_id, "soft_link_to_group1", sb_soft1.linklen, tmpstr) < 0) FAIL_STACK_ERROR
if(HDstrcmp("link_to_group1", tmpstr)) TEST_ERROR
+ /* Test non-existing links with H5Gget_objinfo */
+ H5E_BEGIN_TRY {
+ if(H5Gget_objinfo(file_id, "/group2/soft_link_no_exist", TRUE, NULL) >= 0) FAIL_STACK_ERROR
+ } H5E_END_TRY;
/* Test the dangling soft link */
if(H5Gget_objinfo(file_id, "/group2/dangle_soft_link", FALSE, &sb_soft2) < 0) FAIL_STACK_ERROR
@@ -14103,7 +14107,8 @@ main(void)
nerrors += group_info_old(fapl) < 0 ? 1 : 0;
if (minimize_dset_oh) {
- if (H5Pclose(dcpl_g) < 0) TEST_ERROR;
+ if (H5Pclose(dcpl_g) < 0)
+ TEST_ERROR;
dcpl_g = -1;
}
} /* [un]minimized dataset object headers */
@@ -14141,5 +14146,5 @@ main(void)
error:
HDputs("*** TESTS FAILED ***");
HDexit(EXIT_FAILURE);
-}
+} /* end main() */