summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/getname.c15
-rw-r--r--test/trefer.c4
2 files changed, 16 insertions, 3 deletions
diff --git a/test/getname.c b/test/getname.c
index fbad220..31440d6 100644
--- a/test/getname.c
+++ b/test/getname.c
@@ -2524,6 +2524,14 @@ test_obj_ref(hid_t fapl)
if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
if(!((HDstrcmp(buf, "/Dataset3") == 0) &&(i == 9))) TEST_ERROR
*buf = '\0';
+
+ /* Check H5Rget_name returns the correct length of the name when name is NULL */
+ i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], NULL, 0);
+ if(i != 9) TEST_ERROR
+ /* Make sure size parameter is ignored */
+ i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], NULL, 200);
+ if(i != 9) TEST_ERROR
+
i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], (char*)buf, sizeof(buf));
if(!((HDstrcmp(buf, "/Dataset3") == 0) &&(i == 9))) TEST_ERROR
PASSED()
@@ -2761,7 +2769,12 @@ test_reg_ref(hid_t fapl)
/* Get name of the dataset the first region reference points to using H5Rget_name */
TESTING("H5Rget_name to get name from region reference(hyperslab)");
*buf1 = '\0';
- name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], (char*)buf1, NAME_BUF_SIZE);
+
+ /* Check H5Rget_name returns the correct length of the name when name is NULL */
+ name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], NULL, 0);
+ if(name_size1 != 7) TEST_ERROR
+
+ name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], (char*)buf1, NAME_BUF_SIZE );
if(!((HDstrcmp(buf1, "/MATRIX") == 0) &&(name_size1 == 7))) TEST_ERROR
PASSED()
diff --git a/test/trefer.c b/test/trefer.c
index 698e95a..8f8a28e 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -205,9 +205,9 @@ test_reference_params(void)
name_size = H5Rget_name(-1, H5R_DATASET_REGION, &rbuf[0], NULL, 0);
VERIFY(name_size, FAIL, "H5Rget_name loc_id");
name_size = H5Rget_name(fid1, H5R_DATASET_REGION, NULL, NULL, 0);
- VERIFY(ret, FAIL, "H5Rget_name ref");
+ VERIFY(name_size, FAIL, "H5Rget_name ref");
name_size = H5Rget_name(fid1, H5R_MAXTYPE, &rbuf[0], NULL, 0);
- VERIFY(ret, FAIL, "H5Rget_name type");
+ VERIFY(name_size, FAIL, "H5Rget_name type");
/* Test parameters to H5Rget_region */
ret = H5Rget_region(-1, H5R_OBJECT, &rbuf[0]);