diff options
Diffstat (limited to 'test/ohdr.c')
-rw-r--r-- | test/ohdr.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ohdr.c b/test/ohdr.c index db97805..dad06cf 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -512,6 +512,8 @@ main(void) HDputs("Accessing objects with unknown header messages:"); { hid_t file2; /* File ID for 'bogus' object file */ + hid_t sid; /* Dataspace ID */ + hid_t aid; /* Attribute ID */ const char *testfile = H5_get_srcdir_filename(FILE_BOGUS); TESTING("object with unknown header message and no flags set"); @@ -579,6 +581,22 @@ main(void) if((dset = H5Dopen2(file, "/Dataset3", H5P_DEFAULT)) < 0) TEST_ERROR + /* Create data space */ + if((sid = H5Screate(H5S_SCALAR)) < 0) + FAIL_STACK_ERROR + + /* Create an attribute, to get the object header into write access */ + if((aid = H5Acreate2(dset, "Attr", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Close dataspace */ + if(H5Sclose(sid) < 0) + FAIL_STACK_ERROR + + /* Close attribute */ + if(H5Aclose(aid) < 0) + FAIL_STACK_ERROR + /* Close the dataset */ if(H5Dclose(dset) < 0) TEST_ERROR |