summaryrefslogtreecommitdiffstats
path: root/test/links.c
diff options
context:
space:
mode:
authorJordan Henderson <jhenderson@hdfgroup.org>2019-01-03 04:35:26 (GMT)
committerJordan Henderson <jhenderson@hdfgroup.org>2019-01-03 15:35:44 (GMT)
commit659dd9bccf69f32bfdd01dc49410116ec5c1b0bb (patch)
tree1398cf5b2d9c22cd38bd6e364ba3dde20562532c /test/links.c
parentc820502e69b8c3222bbf1162d21820bebcf71202 (diff)
downloadhdf5-659dd9bccf69f32bfdd01dc49410116ec5c1b0bb.zip
hdf5-659dd9bccf69f32bfdd01dc49410116ec5c1b0bb.tar.gz
hdf5-659dd9bccf69f32bfdd01dc49410116ec5c1b0bb.tar.bz2
Align H5Lcreate_ud behavior with documentation for NULL udata pointer
Add test for H5Lcreate_ud fix
Diffstat (limited to 'test/links.c')
-rw-r--r--test/links.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/links.c b/test/links.c
index b09ddb1..520f784 100644
--- a/test/links.c
+++ b/test/links.c
@@ -8823,6 +8823,12 @@ ud_link_errors(hid_t fapl, hbool_t new_format)
TEST_ERROR
} H5E_END_TRY
+ /* Try to create a link with H5Lcreate_ud that has a NULL udata pointer, but a non-zero udata_size value */
+ H5E_BEGIN_TRY {
+ if(H5Lcreate_ud(fid, "/ud_link", (H5L_type_t)UD_CBFAIL_TYPE, NULL, 1, H5P_DEFAULT, H5P_DEFAULT) >= 0)
+ TEST_ERROR
+ } H5E_END_TRY;
+
/* Create a user-defined link to the group. */
strcpy(group_name, "/group");
if(H5Lcreate_ud(fid, "/ud_link", (H5L_type_t)UD_CBFAIL_TYPE, &group_name, HDstrlen(group_name) + 1, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR