diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2003-12-13 20:08:09 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2003-12-13 20:08:09 (GMT) |
commit | 8dc49da486ae8a29788d58ca312197e1581c4cb1 (patch) | |
tree | 8acf86908b882f99d653691d1cfe5ab63cfc7f74 /test | |
parent | 4feb66edc9ded25aacdcd302f9fcf7d7aef4222b (diff) | |
download | hdf5-8dc49da486ae8a29788d58ca312197e1581c4cb1.zip hdf5-8dc49da486ae8a29788d58ca312197e1581c4cb1.tar.gz hdf5-8dc49da486ae8a29788d58ca312197e1581c4cb1.tar.bz2 |
[svn-r7950] 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')
-rw-r--r-- | test/tattr.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/tattr.c b/test/tattr.c index 653269c..a8e604b 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 attr; /* Attribute 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"); |