summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>1997-10-15 18:57:06 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>1997-10-15 18:57:06 (GMT)
commit6d96cec1badc282ad167f61b67563d6f5e955c21 (patch)
tree863c6f2c17d419a082447ec59b5102cb24118e0e /test
parentbe8f8b160674546bf59a5a59663f53e4de46347e (diff)
downloadhdf5-6d96cec1badc282ad167f61b67563d6f5e955c21.zip
hdf5-6d96cec1badc282ad167f61b67563d6f5e955c21.tar.gz
hdf5-6d96cec1badc282ad167f61b67563d6f5e955c21.tar.bz2
[svn-r123] Added tests for H5Pget_lrank and H5Pget_ldims
Diffstat (limited to 'test')
-rw-r--r--test/th5p.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/test/th5p.c b/test/th5p.c
index 94eeb3b..2d5d3bf 100644
--- a/test/th5p.c
+++ b/test/th5p.c
@@ -57,8 +57,10 @@ static void test_h5p_basic(void)
{
hid_t fid1; /* HDF5 File IDs */
hid_t sid1,sid2; /* Dataspace ID */
+ uint32 rank; /* Logical rank of dataspace */
uint32 dims1[]={SPACE1_DIM1,SPACE1_DIM2,SPACE1_DIM3}, /* dataspace dim sizes */
- dims2[]={SPACE2_DIM1,SPACE2_DIM2,SPACE2_DIM3,SPACE2_DIM4};
+ dims2[]={SPACE2_DIM1,SPACE2_DIM2,SPACE2_DIM3,SPACE2_DIM4},
+ tdims[4]; /* Dimension array to test with */
uintn n; /* number of dataspace elements */
herr_t ret; /* Generic return value */
@@ -79,6 +81,14 @@ static void test_h5p_basic(void)
CHECK(n,UFAIL,"H5Pnelem");
VERIFY(n,SPACE1_DIM1*SPACE1_DIM2*SPACE1_DIM3,"H5Pnelem");
+ rank=H5Pget_lrank(sid1);
+ CHECK(rank,UFAIL,"H5Pget_lrank");
+ VERIFY(rank,SPACE1_RANK,"H5Pget_lrank");
+
+ ret=H5Pget_ldims(sid1,tdims);
+ CHECK(ret,FAIL,"H5Pget_ldims");
+ VERIFY(HDmemcmp(tdims,dims1,SPACE1_RANK*sizeof(uint32)),0,"H5Pget_ldims");
+
sid2=H5Mcreate(fid1,H5_DATASPACE,SPACE2_NAME);
CHECK(sid2,FAIL,"H5Mcreate");
@@ -89,6 +99,14 @@ static void test_h5p_basic(void)
CHECK(n,UFAIL,"H5Pnelem");
VERIFY(n,SPACE2_DIM1*SPACE2_DIM2*SPACE2_DIM3*SPACE2_DIM4,"H5Pnelem");
+ rank=H5Pget_lrank(sid2);
+ CHECK(rank,UFAIL,"H5Pget_lrank");
+ VERIFY(rank,SPACE2_RANK,"H5Pget_lrank");
+
+ ret=H5Pget_ldims(sid2,tdims);
+ CHECK(ret,FAIL,"H5Pget_ldims");
+ VERIFY(HDmemcmp(tdims,dims2,SPACE2_RANK*sizeof(uint32)),0,"H5Pget_ldims");
+
ret=H5Mrelease(sid1);
CHECK(ret,FAIL,"H5Mrelease");