summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>1999-08-27 22:07:00 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>1999-08-27 22:07:00 (GMT)
commit399bab4bf920492b47ca24e6a732cb92956e3106 (patch)
tree1be0c07ad2c28973bf1c8dcecb159efea457cf4d /test
parentee1e2b85226bf4431177d304d9421c243f99e451 (diff)
downloadhdf5-399bab4bf920492b47ca24e6a732cb92956e3106.zip
hdf5-399bab4bf920492b47ca24e6a732cb92956e3106.tar.gz
hdf5-399bab4bf920492b47ca24e6a732cb92956e3106.tar.bz2
[svn-r1613] Added check for reading an attribute immediately after writing it.
Diffstat (limited to 'test')
-rw-r--r--test/tattr.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/tattr.c b/test/tattr.c
index 371ff7c..4a72542 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -101,6 +101,8 @@ test_attr_basic_write(void)
hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
hsize_t dims2[] = {ATTR1_DIM1};
hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2};
+ int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */
+ int i;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -137,6 +139,17 @@ test_attr_basic_write(void)
ret=H5Awrite(attr,H5T_NATIVE_INT,attr_data1);
CHECK(ret, FAIL, "H5Awrite");
+ /* Read attribute information immediately, without closing attribute */
+ ret=H5Aread(attr,H5T_NATIVE_INT,read_data1);
+ CHECK(ret, FAIL, "H5Aread");
+
+ /* Verify values read in */
+ for(i=0; i<ATTR1_DIM1; i++)
+ if(attr_data1[i]!=read_data1[i]) {
+ printf("attribute data different: attr_data1[%d]=%d, read_data1[%d]=%d\n",i,attr_data1[i],i,read_data1[i]);
+ num_errs++;
+ } /* end if */
+
/* Close attribute */
ret=H5Aclose(attr);
CHECK(ret, FAIL, "H5Aclose");