summaryrefslogtreecommitdiffstats
path: root/test/tattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/tattr.c')
-rw-r--r--test/tattr.c16
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");