diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2003-12-13 20:08:11 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2003-12-13 20:08:11 (GMT) |
commit | bbb4d22621213e8a0fcb4cfbe20622acda741ac3 (patch) | |
tree | b6d886a23e3187de006120099090a766129c39ad /test/tattr.c | |
parent | 1214d6e3043820e1fda350e0e667c53239fa0c92 (diff) | |
download | hdf5-bbb4d22621213e8a0fcb4cfbe20622acda741ac3.zip hdf5-bbb4d22621213e8a0fcb4cfbe20622acda741ac3.tar.gz hdf5-bbb4d22621213e8a0fcb4cfbe20622acda741ac3.tar.bz2 |
[svn-r7951] Purpose:
Bug fix
Description:
Attributes which were created with scalar dataspaces were reporting their
dataspace as a simple dataspace when queried later.
Solution:
Fix the dataspace handling code when reading in the attribute message from
the file to set the extent type correctly.
Platforms tested:
FreeBSD 4.9 (sleipnir)
too minor to require h5committest
Diffstat (limited to 'test/tattr.c')
-rw-r--r-- | test/tattr.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/tattr.c b/test/tattr.c index ff64862..5104366 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -721,7 +721,9 @@ test_attr_scalar_read(void) { hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ hid_t attr; /* Attribute ID */ + H5S_class_t stype; /* Dataspace class */ float rdata=0.0; /* Buffer for reading 1st attribute */ herr_t ret; /* Generic return value */ @@ -749,6 +751,18 @@ test_attr_scalar_read(void) CHECK(ret, FAIL, "H5Aread"); VERIFY(rdata, attr_data5, "H5Aread"); + /* Get the attribute's dataspace */ + sid = H5Aget_space(attr); + CHECK(sid, FAIL, "H5Aget_space"); + + /* Make certain the dataspace is scalar */ + stype = H5Sget_simple_extent_type (sid); + VERIFY(stype, H5S_SCALAR, "H5Sget_simple_extent_type"); + + /* Close dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + /* Close attribute */ ret=H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); |