diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2005-02-16 15:34:33 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2005-02-16 15:34:33 (GMT) |
commit | b625ca2b74f5dacd99e78765efab4683e1fc2aec (patch) | |
tree | 47336201e99696d1a406eb20ec7bc98dc525e16a /hl/test/test_ds.c | |
parent | adf0f3e3179c8527cf6920a02324f5eb321f93eb (diff) | |
download | hdf5-b625ca2b74f5dacd99e78765efab4683e1fc2aec.zip hdf5-b625ca2b74f5dacd99e78765efab4683e1fc2aec.tar.gz hdf5-b625ca2b74f5dacd99e78765efab4683e1fc2aec.tar.bz2 |
[svn-r10014] Purpose:
new test
Description:
add a test for the get number of scales function
Solution:
Platforms tested:
linux
solaris
Misc. update:
Diffstat (limited to 'hl/test/test_ds.c')
-rw-r--r-- | hl/test/test_ds.c | 53 |
1 files changed, 44 insertions, 9 deletions
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 43f6429..f891889 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -86,7 +86,8 @@ static int test_simple(void) char s1_label[16]; /* read label for DS 1 */ char s2_label[16]; /* read label for DS 2 */ unsigned int dim; /* dataset dimension index */ - int scale_idx; + int scale_idx; /* scale index */ + int nscales; /* number of scales in DIM */ printf("Testing API functions\n"); @@ -277,11 +278,11 @@ static int test_simple(void) /*------------------------------------------------------------------------- - * test 2: has scales + * test 2: get number of scales *------------------------------------------------------------------------- */ - TESTING2("has scales"); + TESTING2("get number of scales"); /*------------------------------------------------------------------------- * verify that "dset_a" has dimension scales @@ -292,8 +293,18 @@ static int test_simple(void) if ((did = H5Dopen(fid,"dset_a"))<0) goto out; - /* verify that "dset_a" has dimension scales */ - if ((H5DShas_scale(did))==0) + /* verify that "dset_a" has 1 dimension scale at DIM 0 */ + dim=0; + if (H5DSget_nscales(did,dim,&nscales)<0) + goto out; + if (nscales!=1) + goto out; + + /* verify that "dset_a" has 3 dimension scales at DIM 1 */ + dim=1; + if (H5DSget_nscales(did,dim,&nscales)<0) + goto out; + if (nscales!=3) goto out; /* close dataset ID of "dset_a" */ @@ -310,8 +321,18 @@ static int test_simple(void) if ((did = H5Dopen(fid,"dset_b"))<0) goto out; - /* verify that "dset_b" does not have a complete definition of dimension scales */ - if ((H5DShas_scale(did))==1) + /* verify that "dset_b" has 1 dimension scale at DIM 0 */ + dim=0; + if (H5DSget_nscales(did,dim,&nscales)<0) + goto out; + if (nscales!=1) + goto out; + + /* verify that "dset_b" has 0 dimension scales at DIM 1 */ + dim=1; + if (H5DSget_nscales(did,dim,&nscales)<0) + goto out; + if (nscales!=0) goto out; /* close dataset ID of "dset_b" */ @@ -376,7 +397,17 @@ static int test_simple(void) if ((did = H5Dopen(fid,"dset_c"))<0) goto out; - if ((H5DShas_scale(did))==0) + /* verify that "dset_c" has 1 dimension scale at DIM 0 */ + dim=0; + if (H5DSget_nscales(did,dim,&nscales)<0) + goto out; + if (nscales!=1) + goto out; + /* verify that "dset_c" has 1 dimension scale at DIM 1 */ + dim=1; + if (H5DSget_nscales(did,dim,&nscales)<0) + goto out; + if (nscales!=1) goto out; if (H5Dclose(did)<0) goto out; @@ -413,7 +444,11 @@ static int test_simple(void) if ((did = H5Dopen(fid,"dset_c"))<0) goto out; - if ((H5DShas_scale(did))==1) + /* verify that "dset_c" has 0 dimension scale at DIM 0 */ + dim=0; + if (H5DSget_nscales(did,dim,&nscales)<0) + goto out; + if (nscales!=0) goto out; if (H5Dclose(did)<0) goto out; |