summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-12-20 20:51:30 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-12-20 20:51:30 (GMT)
commit5560c64e256d3fc064072afbc0e3f14add0bc5a5 (patch)
tree213f7e15b130c155fb3ebb9ec1cf0a2350eb40c4 /test
parentc9782c380b9f7b25dd13be7d3533b8be784b85b6 (diff)
downloadhdf5-5560c64e256d3fc064072afbc0e3f14add0bc5a5.zip
hdf5-5560c64e256d3fc064072afbc0e3f14add0bc5a5.tar.gz
hdf5-5560c64e256d3fc064072afbc0e3f14add0bc5a5.tar.bz2
[svn-r4747] Purpose:
Bug Fix. Description: The H5Rget_object_type function could not get the object type for dataset region references. Solution: Added a new function, H5Rget_obj_type, to replace H5Rget_object_type. The new function requires the reference type as an additional parameter, in order to allow queries on different reference types to be performed correctly. Platforms tested: FreeBSD 4.4. (sleipnir)
Diffstat (limited to 'test')
-rw-r--r--test/trefer.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/test/trefer.c b/test/trefer.c
index 4d852d9..db5d558 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -155,26 +155,46 @@ test_reference_obj(void)
/* Create reference to dataset */
ret = H5Rcreate(&wbuf[0],fid1,"/Group1/Dataset1",H5R_OBJECT,-1);
CHECK(ret, FAIL, "H5Rcreate");
+#ifdef H5_WANT_H5_V1_4_COMPAT
ret = H5Rget_object_type(dataset,&wbuf[0]);
VERIFY(ret, H5G_DATASET, "H5Rget_object_type");
+#else /* H5_WANT_H5_V1_4_COMPAT */
+ ret = H5Rget_obj_type(dataset,H5R_OBJECT,&wbuf[0]);
+ VERIFY(ret, H5G_DATASET, "H5Rget_obj_type");
+#endif /* H5_WANT_H5_V1_4_COMPAT */
/* Create reference to dataset */
ret = H5Rcreate(&wbuf[1],fid1,"/Group1/Dataset2",H5R_OBJECT,-1);
CHECK(ret, FAIL, "H5Rcreate");
+#ifdef H5_WANT_H5_V1_4_COMPAT
ret = H5Rget_object_type(dataset,&wbuf[1]);
VERIFY(ret, H5G_DATASET, "H5Rget_object_type");
+#else /* H5_WANT_H5_V1_4_COMPAT */
+ ret = H5Rget_obj_type(dataset,H5R_OBJECT,&wbuf[1]);
+ VERIFY(ret, H5G_DATASET, "H5Rget_obj_type");
+#endif /* H5_WANT_H5_V1_4_COMPAT */
/* Create reference to group */
ret = H5Rcreate(&wbuf[2],fid1,"/Group1",H5R_OBJECT,-1);
CHECK(ret, FAIL, "H5Rcreate");
+#ifdef H5_WANT_H5_V1_4_COMPAT
ret = H5Rget_object_type(dataset,&wbuf[2]);
VERIFY(ret, H5G_GROUP, "H5Rget_object_type");
+#else /* H5_WANT_H5_V1_4_COMPAT */
+ ret = H5Rget_obj_type(dataset,H5R_OBJECT,&wbuf[2]);
+ VERIFY(ret, H5G_GROUP, "H5Rget_obj_type");
+#endif /* H5_WANT_H5_V1_4_COMPAT */
/* Create reference to named datatype */
ret = H5Rcreate(&wbuf[3],fid1,"/Group1/Datatype1",H5R_OBJECT,-1);
CHECK(ret, FAIL, "H5Rcreate");
+#ifdef H5_WANT_H5_V1_4_COMPAT
ret = H5Rget_object_type(dataset,&wbuf[3]);
VERIFY(ret, H5G_TYPE, "H5Rget_object_type");
+#else /* H5_WANT_H5_V1_4_COMPAT */
+ ret = H5Rget_obj_type(dataset,H5R_OBJECT,&wbuf[3]);
+ VERIFY(ret, H5G_TYPE, "H5Rget_obj_type");
+#endif /* H5_WANT_H5_V1_4_COMPAT */
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_STD_REF_OBJ,H5S_ALL,H5S_ALL,H5P_DEFAULT,wbuf);
@@ -365,6 +385,8 @@ test_reference_region(void)
/* Store first dataset region */
ret = H5Rcreate(&wbuf[0],fid1,"/Dataset2",H5R_DATASET_REGION,sid2);
CHECK(ret, FAIL, "H5Rcreate");
+ ret = H5Rget_obj_type(dset1,H5R_DATASET_REGION,&wbuf[0]);
+ VERIFY(ret, H5G_DATASET, "H5Rget_obj_type");
/* Select sequence of ten points for second reference */
coord1[0][0]=6; coord1[0][1]=9;
@@ -423,9 +445,9 @@ test_reference_region(void)
dset2 = H5Rdereference(dset1,H5R_DATASET_REGION,&rbuf[0]);
CHECK(dset2, FAIL, "H5Rdereference");
- /* Check what H5Rget_object_type function returns */
- ret = H5Rget_object_type(dset1, &rbuf[0]);
- VERIFY(ret, H5G_UNKNOWN, "H5Rget_object_type");
+ /* Check what H5Rget_obj_type function returns */
+ ret = H5Rget_obj_type(dset1, H5R_DATASET_REGION,&rbuf[0]);
+ VERIFY(ret, H5G_DATASET, "H5Rget_obj_type");
/* Check information in referenced dataset */
sid1 = H5Dget_space(dset2);
@@ -575,8 +597,13 @@ test_reference_obj_deleted(void)
/* Create reference to dataset */
ret = H5Rcreate(&oref,fid1,"/Dataset1",H5R_OBJECT,-1);
CHECK(ret, FAIL, "H5Rcreate");
+#ifdef H5_WANT_H5_V1_4_COMPAT
ret = H5Rget_object_type(dataset,&oref);
VERIFY(ret, H5G_DATASET, "H5Rget_object_type");
+#else /* H5_WANT_H5_V1_4_COMPAT */
+ ret = H5Rget_obj_type(dataset,H5R_OBJECT,&oref);
+ VERIFY(ret, H5G_DATASET, "H5Rget_obj_type");
+#endif /* H5_WANT_H5_V1_4_COMPAT */
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_STD_REF_OBJ,H5S_ALL,H5S_ALL,H5P_DEFAULT,&oref);