diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-01-02 20:21:44 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-01-02 20:21:44 (GMT) |
commit | 76ee1b2bda4d6ab8f39ae1ca9da1940a3b457646 (patch) | |
tree | 59c726a50c3d5b7a34bdc4b5f265400b50e3d312 /test/tattr.c | |
parent | 8081ee4221812ef6f76b9b267bf3b71a930fe0ef (diff) | |
download | hdf5-76ee1b2bda4d6ab8f39ae1ca9da1940a3b457646.zip hdf5-76ee1b2bda4d6ab8f39ae1ca9da1940a3b457646.tar.gz hdf5-76ee1b2bda4d6ab8f39ae1ca9da1940a3b457646.tar.bz2 |
[svn-r13096] Description:
Fix updating values of shared attributes in dense storage & add test.
Tested on:
Linux/32 2.6 (chicago)
Linux/64 2.6 (chicago2)
Diffstat (limited to 'test/tattr.c')
-rw-r--r-- | test/tattr.c | 84 |
1 files changed, 16 insertions, 68 deletions
diff --git a/test/tattr.c b/test/tattr.c index d08f7c9..254771d 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -2156,8 +2156,8 @@ HDfprintf(stderr, "max_compact = %u, min_dense = %u\n", max_compact, min_dense); is_dense = H5O_is_attr_dense_test(dataset2); VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - /* Add attributes to each dataset, until just before converting to dense storage */ - for(u = 0; u < max_compact; u++) { + /* Add attributes to each dataset, until after converting to dense storage */ + for(u = 0; u < max_compact * 2; u++) { /* Create attribute name */ sprintf(attrname, "attr %02u", u); @@ -2183,6 +2183,13 @@ HDfprintf(stderr, "max_compact = %u, min_dense = %u\n", max_compact, min_dense); ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); + /* Check on dataset's attribute storage status */ + is_dense = H5O_is_attr_dense_test(dataset); + if(u < max_compact) + VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); + else + VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test"); + /* Create attribute on second dataset */ attr = H5Acreate(dataset2, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT); @@ -2210,73 +2217,14 @@ HDfprintf(stderr, "max_compact = %u, min_dense = %u\n", max_compact, min_dense); /* Close attribute */ ret = H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); - } /* end for */ - - /* Check on dataset's attribute storage status */ - is_dense = H5O_is_attr_dense_test(dataset); - VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - -#ifdef NOT_YET - /* Add one more attribute, to push into "dense" storage */ - - /* Create attribute name */ - sprintf(attrname, "attr %02u", u); - - /* Create attribute */ - attr = H5Acreate(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT); - CHECK(attr, FAIL, "H5Acreate"); - - /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); - - /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); - - /* Check on dataset's attribute storage status */ - is_dense = H5O_is_attr_dense_test(dataset); - VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test"); - - /* Write data into the attribute */ - attr_value = u + 1; - ret = H5Awrite(attr, H5T_NATIVE_UINT, &attr_value); - CHECK(ret, FAIL, "H5Awrite"); - - /* Close attribute */ - ret = H5Aclose(attr); - CHECK(ret, FAIL, "H5Aclose"); - - - /* Create attribute on second dataset */ - attr = H5Acreate(dataset2, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT); - CHECK(attr, FAIL, "H5Acreate"); - - /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); - - /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); - - /* Write data into the attribute */ - attr_value = u + 1; - ret = H5Awrite(attr, H5T_NATIVE_UINT, &attr_value); - CHECK(ret, FAIL, "H5Awrite"); - - /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); - - /* Close attribute */ - ret = H5Aclose(attr); - CHECK(ret, FAIL, "H5Aclose"); -#endif /* NOT_YET */ + /* Check on dataset's attribute storage status */ + is_dense = H5O_is_attr_dense_test(dataset2); + if(u < max_compact) + VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); + else + VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test"); + } /* end for */ /* Close dataspace */ ret = H5Sclose(sid); |