summaryrefslogtreecommitdiffstats
path: root/test/tattr.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-03-11 23:15:03 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-03-11 23:15:03 (GMT)
commite6b818134e24b1d4d99a612218e0a50ffa08bd28 (patch)
tree1f1e5b6b3bd58d92e395762ccfec6ffde5eaee0a /test/tattr.c
parent0b3cccd0cb2521ef77077d677581d2d3342cdc6f (diff)
downloadhdf5-e6b818134e24b1d4d99a612218e0a50ffa08bd28.zip
hdf5-e6b818134e24b1d4d99a612218e0a50ffa08bd28.tar.gz
hdf5-e6b818134e24b1d4d99a612218e0a50ffa08bd28.tar.bz2
[svn-r13497] Description:
Move ref. count of # of links to an object out of the object header's prefix and make it a header message instead (since it's a "rare" occurence), eliminating some more space for each object in the file. Inserting this "ref. count" message exposed a flaw in the library's mechanism for locating a message to promote to another chunk and replace with a continuation message, which required some additional work to fix. It's still not completely robust, but it's working for more cases now and detects failures robustly. Reduced the minimum size of an object header chunk to just enough to contain a header message prefix and continuation message. Tested on: FreeBSD/32 6.2 (duty)
Diffstat (limited to 'test/tattr.c')
-rw-r--r--test/tattr.c88
1 files changed, 36 insertions, 52 deletions
diff --git a/test/tattr.c b/test/tattr.c
index 897b713..d9ce186 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -6259,16 +6259,6 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
ret = H5Pclose(my_fcpl);
CHECK(ret, FAIL, "H5Pclose");
- /* Commit datatype to file */
- if(test_shared == 2) {
- ret = H5Tcommit(fid, TYPE1_NAME, attr_tid);
- CHECK(ret, FAIL, "H5Tcommit");
-
- /* Close attribute's datatype */
- ret = H5Tclose(attr_tid);
- CHECK(ret, FAIL, "H5Tclose");
- } /* end switch */
-
/* Close file */
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
@@ -6283,10 +6273,10 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
CHECK(fid, FAIL, "H5Fopen");
- /* Re-open attribute datatype as necessary */
+ /* Commit datatype to file */
if(test_shared == 2) {
- attr_tid = H5Topen(fid, TYPE1_NAME);
- CHECK(attr_tid, FAIL, "H5Topen");
+ ret = H5Tcommit(fid, TYPE1_NAME, attr_tid);
+ CHECK(ret, FAIL, "H5Tcommit");
} /* end if */
/* Set up to query the object creation properties */
@@ -6466,6 +6456,12 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
ret = H5Gunlink(fid, DSET2_NAME);
CHECK(ret, FAIL, "H5Gunlink");
+ /* Unlink committed datatype */
+ if(test_shared == 2) {
+ ret = H5Gunlink(fid, TYPE1_NAME);
+ CHECK(ret, FAIL, "H5Gunlink");
+ } /* end if */
+
/* Check on attribute storage status */
ret = H5F_get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
@@ -6588,16 +6584,6 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
ret = H5Pclose(my_fcpl);
CHECK(ret, FAIL, "H5Pclose");
- /* Commit datatype to file */
- if(test_shared == 2) {
- ret = H5Tcommit(fid, TYPE1_NAME, attr_tid);
- CHECK(ret, FAIL, "H5Tcommit");
-
- /* Close attribute's datatype */
- ret = H5Tclose(attr_tid);
- CHECK(ret, FAIL, "H5Tclose");
- } /* end switch */
-
/* Close file */
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
@@ -6612,10 +6598,10 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
CHECK(fid, FAIL, "H5Fopen");
- /* Re-open attribute datatype as necessary */
+ /* Commit datatype to file */
if(test_shared == 2) {
- attr_tid = H5Topen(fid, TYPE1_NAME);
- CHECK(attr_tid, FAIL, "H5Topen");
+ ret = H5Tcommit(fid, TYPE1_NAME, attr_tid);
+ CHECK(ret, FAIL, "H5Tcommit");
} /* end if */
/* Set up to query the object creation properties */
@@ -6911,6 +6897,12 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
ret = H5Gunlink(fid, DSET2_NAME);
CHECK(ret, FAIL, "H5Gunlink");
+ /* Unlink committed datatype */
+ if(test_shared == 2) {
+ ret = H5Gunlink(fid, TYPE1_NAME);
+ CHECK(ret, FAIL, "H5Gunlink");
+ } /* end if */
+
/* Check on attribute storage status */
ret = H5F_get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
@@ -7032,16 +7024,6 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
ret = H5Pclose(my_fcpl);
CHECK(ret, FAIL, "H5Pclose");
- /* Commit datatype to file */
- if(test_shared == 2) {
- ret = H5Tcommit(fid, TYPE1_NAME, attr_tid);
- CHECK(ret, FAIL, "H5Tcommit");
-
- /* Close attribute's datatype */
- ret = H5Tclose(attr_tid);
- CHECK(ret, FAIL, "H5Tclose");
- } /* end switch */
-
/* Close file */
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
@@ -7056,10 +7038,10 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
CHECK(fid, FAIL, "H5Fopen");
- /* Re-open attribute datatype as necessary */
+ /* Commit datatype to file */
if(test_shared == 2) {
- attr_tid = H5Topen(fid, TYPE1_NAME);
- CHECK(attr_tid, FAIL, "H5Topen");
+ ret = H5Tcommit(fid, TYPE1_NAME, attr_tid);
+ CHECK(ret, FAIL, "H5Tcommit");
} /* end if */
/* Set up to query the object creation properties */
@@ -7278,6 +7260,12 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
ret = H5Gunlink(fid, DSET2_NAME);
CHECK(ret, FAIL, "H5Gunlink");
+ /* Unlink committed datatype */
+ if(test_shared == 2) {
+ ret = H5Gunlink(fid, TYPE1_NAME);
+ CHECK(ret, FAIL, "H5Gunlink");
+ } /* end if */
+
/* Check on attribute storage status */
ret = H5F_get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
@@ -7399,16 +7387,6 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
ret = H5Pclose(my_fcpl);
CHECK(ret, FAIL, "H5Pclose");
- /* Commit datatype to file */
- if(test_shared == 2) {
- ret = H5Tcommit(fid, TYPE1_NAME, attr_tid);
- CHECK(ret, FAIL, "H5Tcommit");
-
- /* Close attribute's datatype */
- ret = H5Tclose(attr_tid);
- CHECK(ret, FAIL, "H5Tclose");
- } /* end switch */
-
/* Close file */
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
@@ -7423,10 +7401,10 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
CHECK(fid, FAIL, "H5Fopen");
- /* Re-open attribute datatype as necessary */
+ /* Commit datatype to file */
if(test_shared == 2) {
- attr_tid = H5Topen(fid, TYPE1_NAME);
- CHECK(attr_tid, FAIL, "H5Topen");
+ ret = H5Tcommit(fid, TYPE1_NAME, attr_tid);
+ CHECK(ret, FAIL, "H5Tcommit");
} /* end if */
/* Set up to query the object creation properties */
@@ -7631,6 +7609,12 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
ret = H5Gunlink(fid, DSET1_NAME);
CHECK(ret, FAIL, "H5Gunlink");
+ /* Unlink committed datatype */
+ if(test_shared == 2) {
+ ret = H5Gunlink(fid, TYPE1_NAME);
+ CHECK(ret, FAIL, "H5Gunlink");
+ } /* end if */
+
/* Check on attribute storage status */
ret = H5F_get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");