diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-03-08 20:10:12 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-03-08 20:10:12 (GMT) |
commit | 74a30fff3e0fcd8919ced487abd03eefd27d57c1 (patch) | |
tree | 2df0a0d2cfc51cce067f25e503e6dfd26c8e827d /test/tattr.c | |
parent | 25bb6f5dd8af42d2facaab26f0cdeb7fc76456ae (diff) | |
download | hdf5-74a30fff3e0fcd8919ced487abd03eefd27d57c1.zip hdf5-74a30fff3e0fcd8919ced487abd03eefd27d57c1.tar.gz hdf5-74a30fff3e0fcd8919ced487abd03eefd27d57c1.tar.bz2 |
[svn-r13477] Description:
The main purpose of this checkin was to eliminate the
space used for tracking creation time indices when there is no way they
can be used (i.e. attributes can't be shared in the file and the user hasn't
turned on attribute creation tracking), however there were some other minor
changes which crept in:
- Fix a cache locking deadlock when a shared attribute and one of its
components end up in the same fractal heap direct block.
(This is fixed the "slow" way for right now, until John has time
to add support for readers/writer locking to the cache.
- Optimize attribute copying when a copy will be kept during a v2 B-tree
search.
- When freeing a block on disk, attempt to merge it with the metadata
and "small data" aggregators.
Tested on:
Mac OS X/32 10.4.8 (amazon)
FreeBSD/32 6.2 (duty)
Diffstat (limited to 'test/tattr.c')
-rw-r--r-- | test/tattr.c | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/test/tattr.c b/test/tattr.c index e0d08e8..cf8f5d4 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -1753,15 +1753,19 @@ test_attr_dtype_shared(hid_t fapl) ** Verify attributes on object ** ****************************************************************/ -static void +static int test_attr_dense_verify(hid_t loc_id, unsigned max_attr) { char attrname[NAME_BUF_SIZE]; /* Name of attribute */ hid_t attr; /* Attribute ID */ unsigned value; /* Attribute value */ unsigned u; /* Local index variable */ + int old_nerrs; /* Number of errors when entering this check */ herr_t ret; /* Generic return value */ + /* Retrieve the current # of reported errors */ + old_nerrs = GetTestNumErrs(); + /* Re-open all the attributes by name and verify the data */ for(u = 0; u < max_attr; u++) { /* Open attribute */ @@ -1804,6 +1808,12 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr) ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); } /* end for */ + + /* Retrieve current # of errors */ + if(old_nerrs == GetTestNumErrs()) + return(0); + else + return(-1); } /* test_attr_dense_verify() */ @@ -1989,6 +1999,10 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) dcpl = H5Pcreate(H5P_DATASET_CREATE); CHECK(dcpl, FAIL, "H5Pcreate"); + /* Enable creation order tracking on attributes, so creation order tests work */ + ret = H5Pset_attr_creation_order(dcpl, H5P_CRT_ORDER_TRACKED); + CHECK(ret, FAIL, "H5Pset_attr_creation_order"); + /* Create a dataset */ dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); CHECK(dataset, FAIL, "H5Dcreate"); @@ -2021,7 +2035,8 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); /* Verify attributes written so far */ - test_attr_dense_verify(dataset, u); + ret = test_attr_dense_verify(dataset, u); + CHECK(ret, FAIL, "test_attr_dense_verify"); } /* end for */ /* Check on dataset's attribute storage status */ @@ -2051,7 +2066,8 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); /* Verify all the attributes written */ - test_attr_dense_verify(dataset, (u + 1)); + ret = test_attr_dense_verify(dataset, (u + 1)); + CHECK(ret, FAIL, "test_attr_dense_verify"); /* Close Dataset */ ret = H5Dclose(dataset); @@ -2123,6 +2139,10 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) dcpl = H5Pcreate(H5P_DATASET_CREATE); CHECK(dcpl, FAIL, "H5Pcreate"); + /* Enable creation order tracking on attributes, so creation order tests work */ + ret = H5Pset_attr_creation_order(dcpl, H5P_CRT_ORDER_TRACKED); + CHECK(ret, FAIL, "H5Pset_attr_creation_order"); + /* Create a dataset */ dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); CHECK(dataset, FAIL, "H5Dcreate"); @@ -2193,7 +2213,8 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Adelete"); /* Verify attributes still left */ - test_attr_dense_verify(dataset, u); + ret = test_attr_dense_verify(dataset, u); + CHECK(ret, FAIL, "test_attr_dense_verify"); } /* end for */ /* Check on dataset's attribute storage status */ @@ -2210,7 +2231,8 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); /* Verify attributes still left */ - test_attr_dense_verify(dataset, (u - 1)); + ret = test_attr_dense_verify(dataset, (u - 1)); + CHECK(ret, FAIL, "test_attr_dense_verify"); /* Delete another attribute, to verify deletion in compact storage */ sprintf(attrname, "attr %02u", (u - 1)); @@ -2222,7 +2244,8 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); /* Verify attributes still left */ - test_attr_dense_verify(dataset, (u - 2)); + ret = test_attr_dense_verify(dataset, (u - 2)); + CHECK(ret, FAIL, "test_attr_dense_verify"); /* Close Dataset */ ret = H5Dclose(dataset); |