summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2011-07-18 21:23:02 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2011-07-18 21:23:02 (GMT)
commit304f19d73093427faa319dc04926461d850032a0 (patch)
tree0ebc5fc91522e25fcd9057c2bd931aab3452a6ab /test
parentcc0486926f52a25a252f560d35fba7d4cf73f521 (diff)
downloadhdf5-304f19d73093427faa319dc04926461d850032a0.zip
hdf5-304f19d73093427faa319dc04926461d850032a0.tar.gz
hdf5-304f19d73093427faa319dc04926461d850032a0.tar.bz2
[svn-r21117] Issue 2763 - I added a new parameter of object access property list to the function H5Rdereference. It's called H5Rdereference2 now. H5Rdereference function has been deprecated to H5Rdereference1. I also added some test cases in trefer.c.
Tested on jam, heiwa, and koala.
Diffstat (limited to 'test')
-rw-r--r--test/getname.c24
-rw-r--r--test/ntypes.c4
-rwxr-xr-xtest/objcopy.c8
-rw-r--r--test/trefer.c128
-rw-r--r--test/tunicode.c2
5 files changed, 120 insertions, 46 deletions
diff --git a/test/getname.c b/test/getname.c
index 1e50dcc..2a3145b 100644
--- a/test/getname.c
+++ b/test/getname.c
@@ -2518,7 +2518,7 @@ test_obj_ref(hid_t fapl)
FAIL_STACK_ERROR
TESTING("getting path to normal dataset in root group");
- if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[0])) < 0) FAIL_STACK_ERROR
+ if((dataset2 = H5Rdereference2(dataset, H5P_DATASET_ACCESS_DEFAULT, H5R_OBJECT, &wbuf[0])) < 0) FAIL_STACK_ERROR
*buf = '\0';
i = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
@@ -2530,7 +2530,7 @@ test_obj_ref(hid_t fapl)
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to dataset in /Group1");
- if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[1])) < 0) FAIL_STACK_ERROR
+ if((dataset2 = H5Rdereference2(dataset, H5P_DATASET_ACCESS_DEFAULT, H5R_OBJECT, &wbuf[1])) < 0) FAIL_STACK_ERROR
*buf = '\0';
i = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
@@ -2542,7 +2542,7 @@ test_obj_ref(hid_t fapl)
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to /Group1");
- if((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[2])) < 0) FAIL_STACK_ERROR
+ if((group = H5Rdereference2(dataset, H5P_DATASET_ACCESS_DEFAULT, H5R_OBJECT, &wbuf[2])) < 0) FAIL_STACK_ERROR
*buf = '\0';
i = H5Iget_name(group, (char*)buf, sizeof(buf));
if(H5Gclose(group) < 0) FAIL_STACK_ERROR
@@ -2554,7 +2554,7 @@ test_obj_ref(hid_t fapl)
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to datatype in /Group1");
- if((tid1 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[3])) < 0) FAIL_STACK_ERROR
+ if((tid1 = H5Rdereference2(dataset, H5P_DATASET_ACCESS_DEFAULT, H5R_OBJECT, &wbuf[3])) < 0) FAIL_STACK_ERROR
*buf = '\0';
i = H5Iget_name(tid1, (char*)buf, sizeof(buf));
if(H5Tclose(tid1) < 0) FAIL_STACK_ERROR
@@ -2566,7 +2566,7 @@ test_obj_ref(hid_t fapl)
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to dataset in nested group");
- if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[4])) < 0) FAIL_STACK_ERROR
+ if((dataset2 = H5Rdereference2(dataset, H5P_DATASET_ACCESS_DEFAULT, H5R_OBJECT, &wbuf[4])) < 0) FAIL_STACK_ERROR
*buf = '\0';
i = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
@@ -2578,7 +2578,7 @@ test_obj_ref(hid_t fapl)
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to nested group");
- if((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[5])) < 0) FAIL_STACK_ERROR
+ if((group = H5Rdereference2(dataset, H5P_DATASET_ACCESS_DEFAULT, H5R_OBJECT, &wbuf[5])) < 0) FAIL_STACK_ERROR
*buf = '\0';
i = H5Iget_name(group, (char*)buf, sizeof(buf));
if(H5Gclose(group) < 0) FAIL_STACK_ERROR
@@ -2590,7 +2590,7 @@ test_obj_ref(hid_t fapl)
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to dataset created via hard link");
- if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[6])) < 0) FAIL_STACK_ERROR
+ if((dataset2 = H5Rdereference2(dataset, H5P_DATASET_ACCESS_DEFAULT, H5R_OBJECT, &wbuf[6])) < 0) FAIL_STACK_ERROR
*buf = '\0';
i = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
@@ -2602,7 +2602,7 @@ test_obj_ref(hid_t fapl)
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to root group");
- if((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[7])) < 0) FAIL_STACK_ERROR
+ if((group = H5Rdereference2(dataset, H5P_DATASET_ACCESS_DEFAULT, H5R_OBJECT, &wbuf[7])) < 0) FAIL_STACK_ERROR
*buf = '\0';
i = H5Iget_name(group, (char*)buf, sizeof(buf));
if(H5Gclose(group) < 0) FAIL_STACK_ERROR
@@ -2617,7 +2617,7 @@ test_obj_ref(hid_t fapl)
FAIL_STACK_ERROR
TESTING("getting path to dataset hidden by a mounted file");
- if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[4])) < 0) FAIL_STACK_ERROR
+ if((dataset2 = H5Rdereference2(dataset, H5P_DATASET_ACCESS_DEFAULT, H5R_OBJECT, &wbuf[4])) < 0) FAIL_STACK_ERROR
*buf = '\0';
i = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
@@ -2628,7 +2628,7 @@ test_obj_ref(hid_t fapl)
PASSED()
/* Now we try unlinking dataset2 from the file and searching for it. It shouldn't be found */
- if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[1])) < 0)
+ if((dataset2 = H5Rdereference2(dataset, H5P_DATASET_ACCESS_DEFAULT, H5R_OBJECT, &wbuf[1])) < 0)
FAIL_STACK_ERROR
if(H5Ldelete(fid1, "/Group1/Dataset2", H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
@@ -2768,7 +2768,7 @@ test_reg_ref(hid_t fapl)
TESTING("H5Iget_name to get name from region reference(hyperslab)");
/* Dereference the first reference */
- dsetv_id = H5Rdereference(dsetr_id, H5R_DATASET_REGION, &ref_out[0]);
+ dsetv_id = H5Rdereference2(dsetr_id, H5P_DATASET_ACCESS_DEFAULT, H5R_DATASET_REGION, &ref_out[0]);
/* Get name of the dataset the first region reference points using H5Iget_name */
*buf2 = '\0';
@@ -2789,7 +2789,7 @@ test_reg_ref(hid_t fapl)
TESTING("H5Iget_name to get name from region reference(pnt selec)");
/* Dereference the second reference */
- if((dsetv_id = H5Rdereference(dsetr_id, H5R_DATASET_REGION, &ref_out[1])) < 0) TEST_ERROR
+ if((dsetv_id = H5Rdereference2(dsetr_id, H5P_DATASET_ACCESS_DEFAULT, H5R_DATASET_REGION, &ref_out[1])) < 0) TEST_ERROR
/* Get name of the dataset the first region reference points using H5Iget_name */
*buf2 = '\0';
diff --git a/test/ntypes.c b/test/ntypes.c
index 3310a82..0fa82e5 100644
--- a/test/ntypes.c
+++ b/test/ntypes.c
@@ -2187,7 +2187,7 @@ test_refer_dtype(hid_t file)
TEST_ERROR;
/* Open datatype object */
- if((tid1 = H5Rdereference(dataset, H5R_OBJECT, rbuf)) < 0)
+ if((tid1 = H5Rdereference2(dataset, H5P_DATASET_ACCESS_DEFAULT, H5R_OBJECT, rbuf)) < 0)
TEST_ERROR;
/* Verify correct datatype */
@@ -2372,7 +2372,7 @@ test_refer_dtype2(hid_t file)
TEST_ERROR;
/* Try to open objects */
- if((dset2 = H5Rdereference(dset1, H5R_DATASET_REGION, &rbuf)) < 0)
+ if((dset2 = H5Rdereference2(dset1, H5P_DATASET_ACCESS_DEFAULT, H5R_DATASET_REGION, &rbuf)) < 0)
TEST_ERROR;
/* Check what H5Rget_obj_type2 function returns */
diff --git a/test/objcopy.c b/test/objcopy.c
index 8d045c2..f2b637c 100755
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -971,8 +971,8 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
if(obj1_type != obj2_type) TEST_ERROR
/* Open referenced objects */
- if((obj1_id = H5Rdereference(parent1, H5R_OBJECT, ref_buf1)) < 0) TEST_ERROR
- if((obj2_id = H5Rdereference(parent2, H5R_OBJECT, ref_buf2)) < 0) TEST_ERROR
+ if((obj1_id = H5Rdereference2(parent1, H5P_DATASET_ACCESS_DEFAULT, H5R_OBJECT, ref_buf1)) < 0) TEST_ERROR
+ if((obj2_id = H5Rdereference2(parent2, H5P_DATASET_ACCESS_DEFAULT, H5R_OBJECT, ref_buf2)) < 0) TEST_ERROR
/* break the infinite loop when the ref_object points to itself */
if(obj_owner > 0) {
@@ -1029,8 +1029,8 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
if(obj1_type != obj2_type) TEST_ERROR
/* Open referenced objects */
- if((obj1_id = H5Rdereference(parent1, H5R_DATASET_REGION, ref_buf1)) < 0) TEST_ERROR
- if((obj2_id = H5Rdereference(parent2, H5R_DATASET_REGION, ref_buf2)) < 0) TEST_ERROR
+ if((obj1_id = H5Rdereference2(parent1, H5P_DATASET_ACCESS_DEFAULT, H5R_DATASET_REGION, ref_buf1)) < 0) TEST_ERROR
+ if((obj2_id = H5Rdereference2(parent2, H5P_DATASET_ACCESS_DEFAULT, H5R_DATASET_REGION, ref_buf2)) < 0) TEST_ERROR
/* break the infinite loop when the ref_object points to itself */
if(obj_owner > 0) {
diff --git a/test/trefer.c b/test/trefer.c
index 4ab3fba..dbecc53 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -75,6 +75,7 @@ test_reference_params(void)
hid_t group; /* Group ID */
hid_t sid1; /* Dataspace ID */
hid_t tid1; /* Datatype ID */
+ hid_t dapl_id; /* Dataset access property list */
hsize_t dims1[] = {SPACE1_DIM1};
hobj_ref_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
@@ -101,6 +102,10 @@ test_reference_params(void)
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
CHECK(sid1, FAIL, "H5Screate_simple");
+ /* Create dataset access property list */
+ dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
+ CHECK(dapl_id, FAIL, "H5Pcreate");
+
/* Create a group */
group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(group, FAIL, "H5Gcreate2");
@@ -179,11 +184,11 @@ test_reference_params(void)
VERIFY(ret, FAIL, "H5Rcreate space");
/* Test parameters to H5Rdereference */
- dset2 = H5Rdereference(-1, H5R_OBJECT, &rbuf[0]);
+ dset2 = H5Rdereference2(-1, H5P_DATASET_ACCESS_DEFAULT, H5R_OBJECT, &rbuf[0]);
VERIFY(dset2, FAIL, "H5Rdereference loc_id");
- dset2 = H5Rdereference(dataset, H5R_OBJECT, NULL);
+ dset2 = H5Rdereference2(dataset, dapl_id, H5R_OBJECT, NULL);
VERIFY(dset2, FAIL, "H5Rdereference ref");
- dset2 = H5Rdereference(dataset, H5R_MAXTYPE, &rbuf[0]);
+ dset2 = H5Rdereference2(dataset, dapl_id, H5R_MAXTYPE, &rbuf[0]);
VERIFY(dset2, FAIL, "H5Rdereference type");
/* Test parameters to H5Rget_obj_type2 */
@@ -214,6 +219,10 @@ test_reference_params(void)
ret = H5Sclose(sid1);
CHECK(ret, FAIL, "H5Sclose");
+ /* Close dataset access property list */
+ ret = H5Pclose(dapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
/* Close Dataset */
ret = H5Dclose(dataset);
CHECK(ret, FAIL, "H5Dclose");
@@ -237,23 +246,24 @@ test_reference_params(void)
static void
test_reference_obj(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset, /* Dataset ID */
- dset2; /* Dereferenced dataset ID */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset, /* Dataset ID */
+ dset2; /* Dereferenced dataset ID */
hid_t group; /* Group ID */
hid_t sid1; /* Dataspace ID */
hid_t tid1; /* Datatype ID */
hsize_t dims1[] = {SPACE1_DIM1};
- hobj_ref_t *wbuf, /* buffer to write to disk */
- *rbuf, /* buffer read from disk */
- *tbuf; /* temp. buffer read from disk */
+ hid_t dapl_id; /* Dataset access property list */
+ hobj_ref_t *wbuf, /* buffer to write to disk */
+ *rbuf, /* buffer read from disk */
+ *tbuf; /* temp. buffer read from disk */
hobj_ref_t nvrbuf[3]={0,101,1000000000}; /* buffer with non-valid refs */
- unsigned *tu32; /* Temporary pointer to uint32 data */
- int i, j; /* counting variables */
+ unsigned *tu32; /* Temporary pointer to uint32 data */
+ int i, j; /* counting variables */
const char *write_comment="Foo!"; /* Comments for group */
char read_comment[10];
- H5O_type_t obj_type; /* Object type */
- herr_t ret; /* Generic return value */
+ H5O_type_t obj_type; /* Object type */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Object Reference Functions\n"));
@@ -271,6 +281,10 @@ test_reference_obj(void)
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
CHECK(sid1, FAIL, "H5Screate_simple");
+ /* Create dataset access property list */
+ dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
+ CHECK(dapl_id, FAIL, "H5Pcreate");
+
/* Create a group */
group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(group, FAIL, "H5Gcreate2");
@@ -389,7 +403,7 @@ test_reference_obj(void)
CHECK(ret, FAIL, "H5Dread");
/* Open dataset object */
- dset2 = H5Rdereference(dataset, H5R_OBJECT, &rbuf[0]);
+ dset2 = H5Rdereference2(dataset, dapl_id, H5R_OBJECT, &rbuf[0]);
CHECK(dset2, FAIL, "H5Rdereference");
/* Check information in referenced dataset */
@@ -410,8 +424,8 @@ test_reference_obj(void)
ret = H5Dclose(dset2);
CHECK(ret, FAIL, "H5Dclose");
- /* Open group object */
- group = H5Rdereference(dataset, H5R_OBJECT, &rbuf[2]);
+ /* Open group object. GAPL isn't supported yet. But it's harmless to pass in */
+ group = H5Rdereference2(dataset, H5P_GROUP_ACCESS_DEFAULT, H5R_OBJECT, &rbuf[2]);
CHECK(group, FAIL, "H5Rdereference");
/* Get group's comment */
@@ -426,8 +440,8 @@ test_reference_obj(void)
ret = H5Gclose(group);
CHECK(ret, FAIL, "H5Gclose");
- /* Open datatype object */
- tid1 = H5Rdereference(dataset, H5R_OBJECT, &rbuf[3]);
+ /* Open datatype object. TAPL isn't supported yet. But it's harmless to pass in */
+ tid1 = H5Rdereference2(dataset, H5P_DATATYPE_ACCESS_DEFAULT, H5R_OBJECT, &rbuf[3]);
CHECK(tid1, FAIL, "H5Rdereference");
/* Verify correct datatype */
@@ -457,6 +471,10 @@ test_reference_obj(void)
ret = H5Dclose(dataset);
CHECK(ret, FAIL, "H5Dclose");
+ /* Close dataset access property list */
+ ret = H5Pclose(dapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
/* Close file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
@@ -481,6 +499,7 @@ test_reference_region(void)
dset2; /* Dereferenced dataset ID */
hid_t sid1, /* Dataspace ID #1 */
sid2; /* Dataspace ID #2 */
+ hid_t dapl_id; /* Dataset access property list */
hsize_t dims1[] = {SPACE1_DIM1},
dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
@@ -518,6 +537,10 @@ test_reference_region(void)
sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL);
CHECK(sid2, FAIL, "H5Screate_simple");
+ /* Create dataset access property list */
+ dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
+ CHECK(dapl_id, FAIL, "H5Pcreate");
+
/* Create a dataset */
dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(dset2, FAIL, "H5Dcreate2");
@@ -615,7 +638,7 @@ test_reference_region(void)
CHECK(ret, FAIL, "H5Dread");
/* Try to open objects */
- dset2 = H5Rdereference(dset1, H5R_DATASET_REGION, &rbuf[0]);
+ dset2 = H5Rdereference2(dset1, dapl_id, H5R_DATASET_REGION, &rbuf[0]);
CHECK(dset2, FAIL, "H5Rdereference");
/* Check what H5Rget_obj_type2 function returns */
@@ -729,6 +752,10 @@ test_reference_region(void)
ret = H5Dclose(dset1);
CHECK(ret, FAIL, "H5Dclose");
+ /* Close dataset access property list */
+ ret = H5Pclose(dapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
/* Close file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
@@ -754,6 +781,7 @@ test_reference_region_1D(void)
dset3; /* Dereferenced dataset ID */
hid_t sid1, /* Dataspace ID #1 */
sid3; /* Dataspace ID #3 */
+ hid_t dapl_id; /* Dataset access property list */
hsize_t dims1[] = {SPACE1_DIM1},
dims3[] = {SPACE3_DIM1};
hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */
@@ -790,6 +818,10 @@ test_reference_region_1D(void)
sid3 = H5Screate_simple(SPACE3_RANK, dims3, NULL);
CHECK(sid3, FAIL, "H5Screate_simple");
+ /* Create dataset access property list */
+ dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
+ CHECK(dapl_id, FAIL, "H5Pcreate");
+
/* Create a dataset */
dset3 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(dset3, FAIL, "H5Dcreate2");
@@ -887,7 +919,7 @@ test_reference_region_1D(void)
CHECK(ret, FAIL, "H5Dread");
/* Try to open objects */
- dset3 = H5Rdereference(dset1, H5R_DATASET_REGION, &rbuf[0]);
+ dset3 = H5Rdereference2(dset1, dapl_id, H5R_DATASET_REGION, &rbuf[0]);
CHECK(dset3, FAIL, "H5Rdereference");
/* Check what H5Rget_obj_type2 function returns */
@@ -1005,6 +1037,10 @@ test_reference_region_1D(void)
ret = H5Dclose(dset1);
CHECK(ret, FAIL, "H5Dclose");
+ /* Close dataset access property list */
+ ret = H5Pclose(dapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
/* Close file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
@@ -1094,12 +1130,12 @@ test_reference_obj_deleted(void)
CHECK(ret, FAIL, "H5Dread");
/* Open deleted dataset object */
- dset2 = H5Rdereference(dataset, H5R_OBJECT, &oref);
+ dset2 = H5Rdereference2(dataset, H5P_DATASET_ACCESS_DEFAULT, H5R_OBJECT, &oref);
VERIFY(dset2, FAIL, "H5Rdereference");
/* Open nonsense reference */
HDmemset(&oref, 0, sizeof(hobj_ref_t));
- dset2 = H5Rdereference(dataset, H5R_OBJECT, &oref);
+ dset2 = H5Rdereference2(dataset, H5P_DATASET_ACCESS_DEFAULT, H5R_OBJECT, &oref);
VERIFY(dset2, FAIL, "H5Rdereference");
/* Close Dataset */
@@ -1238,7 +1274,7 @@ test_reference_group(void)
CHECK(ret, FAIL, "H5Dread");
/* Dereference to get the group */
- gid = H5Rdereference(did, H5R_OBJECT, &rref);
+ gid = H5Rdereference2(did, H5P_GROUP_ACCESS_DEFAULT, H5R_OBJECT, &rref);
CHECK(gid, FAIL, "H5Rdereference");
/* Iterate through objects in dereferenced group */
@@ -1286,11 +1322,11 @@ static void
test_reference_compat(void)
{
hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t group; /* Group ID */
+ hid_t dataset, dset2; /* Dataset ID */
+ hid_t group, group2; /* Group ID */
hid_t sid1, /* Dataspace IDs */
sid2;
- hid_t tid1; /* Datatype ID */
+ hid_t tid1, tid2; /* Datatype ID */
hsize_t dims1[] = {SPACE1_DIM1},
dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
@@ -1485,6 +1521,32 @@ test_reference_compat(void)
CHECK(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1");
VERIFY(obj_type, H5G_TYPE, "H5Rget_obj_type1");
+
+ /* Make sure the referenced objects can be opened */
+ dset2 = H5Rdereference1(dataset, H5R_OBJECT, &rbuf_obj[0]);
+ CHECK(dset2, FAIL, "H5Rdereference1");
+
+ ret = H5Dclose(dset2);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ dset2 = H5Rdereference1(dataset, H5R_OBJECT, &rbuf_obj[1]);
+ CHECK(dset2, FAIL, "H5Rdereference1");
+
+ ret = H5Dclose(dset2);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ group2 = H5Rdereference1(dataset, H5R_OBJECT, &rbuf_obj[2]);
+ CHECK(group2, FAIL, "H5Rdereference1");
+
+ ret = H5Gclose(group2);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ tid2 = H5Rdereference1(dataset, H5R_OBJECT, &rbuf_obj[3]);
+ CHECK(tid2, FAIL, "H5Rdereference1");
+
+ ret = H5Tclose(tid2);
+ CHECK(ret, FAIL, "H5Tclose");
+
/* Close Dataset */
ret = H5Dclose(dataset);
CHECK(ret, FAIL, "H5Dclose");
@@ -1513,11 +1575,23 @@ test_reference_compat(void)
obj_type = H5Rget_obj_type1(dataset, H5R_DATASET_REGION, &rbuf_reg[3]);
VERIFY(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1");
+ /* Make sure the referenced objects can be opened */
+ dset2 = H5Rdereference1(dataset, H5R_DATASET_REGION, &rbuf_reg[0]);
+ CHECK(dset2, FAIL, "H5Rdereference1");
+
+ ret = H5Dclose(dset2);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ dset2 = H5Rdereference1(dataset, H5R_DATASET_REGION, &rbuf_reg[1]);
+ CHECK(dset2, FAIL, "H5Rdereference1");
+
+ ret = H5Dclose(dset2);
+ CHECK(ret, FAIL, "H5Dclose");
+
/* Close Dataset */
ret = H5Dclose(dataset);
CHECK(ret, FAIL, "H5Dclose");
-
/* Close file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
diff --git a/test/tunicode.c b/test/tunicode.c
index 892e563..e28c38b 100644
--- a/test/tunicode.c
+++ b/test/tunicode.c
@@ -464,7 +464,7 @@ void test_objnames(hid_t fid, const char* string)
CHECK(ret, FAIL, "H5Dread");
/* Ensure that we can open named datatype using object reference */
- type_id = H5Rdereference(dset_id, H5R_OBJECT, &obj_ref);
+ type_id = H5Rdereference2(dset_id, H5P_DATASET_ACCESS_DEFAULT, H5R_OBJECT, &obj_ref);
CHECK(type_id, FAIL, "H5Rdereference");
ret = H5Tcommitted(type_id);
VERIFY(ret, 1, "H5Tcommitted");