summaryrefslogtreecommitdiffstats
path: root/test
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
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')
-rwxr-xr-xtest/objcopy.c4
-rw-r--r--test/stab.c8
-rw-r--r--test/tattr.c88
-rw-r--r--test/tfile.c2
4 files changed, 43 insertions, 59 deletions
diff --git a/test/objcopy.c b/test/objcopy.c
index 71cd247..8cc1027 100755
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -1255,11 +1255,11 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
* of messages hasn't increased.
*/
if(H5O_COPY_PRESERVE_NULL_FLAG & copy_flags) {
- if(objstat.ohdr.nmesgs != objstat2.ohdr.nmesgs);
+ if(objstat.ohdr.nmesgs != objstat2.ohdr.nmesgs)
+ ;
else
if(objstat.ohdr.nmesgs < objstat2.ohdr.nmesgs) TEST_ERROR
}
- if(1 != objstat2.ohdr.nchunks) TEST_ERROR
} /* end if */
/* Get link info */
diff --git a/test/stab.c b/test/stab.c
index adf9803..73e1645 100644
--- a/test/stab.c
+++ b/test/stab.c
@@ -427,9 +427,9 @@ lifecycle(hid_t fapl)
/* Check that the object header is only one chunk and the space has been allocated correctly */
if(H5Gget_objinfo(gid, ".", FALSE, &obj_stat) < 0) TEST_ERROR
#ifdef H5_HAVE_LARGE_HSIZET
- if(obj_stat.ohdr.size != 163) TEST_ERROR
+ if(obj_stat.ohdr.size != 159) TEST_ERROR
#else /* H5_HAVE_LARGE_HSIZET */
- if(obj_stat.ohdr.size != 143) TEST_ERROR
+ if(obj_stat.ohdr.size != 139) TEST_ERROR
#endif /* H5_HAVE_LARGE_HSIZET */
if(obj_stat.ohdr.free != 0) TEST_ERROR
if(obj_stat.ohdr.nmesgs != 6) TEST_ERROR
@@ -453,9 +453,9 @@ lifecycle(hid_t fapl)
/* Check that the object header is still one chunk and the space has been allocated correctly */
if(H5Gget_objinfo(gid, ".", FALSE, &obj_stat) < 0) TEST_ERROR
#ifdef H5_HAVE_LARGE_HSIZET
- if(obj_stat.ohdr.size != 163) TEST_ERROR
+ if(obj_stat.ohdr.size != 159) TEST_ERROR
#else /* H5_HAVE_LARGE_HSIZET */
- if(obj_stat.ohdr.size != 143) TEST_ERROR
+ if(obj_stat.ohdr.size != 139) TEST_ERROR
#endif /* H5_HAVE_LARGE_HSIZET */
if(obj_stat.ohdr.free != 92) TEST_ERROR
if(obj_stat.ohdr.nmesgs != 3) TEST_ERROR
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");
diff --git a/test/tfile.c b/test/tfile.c
index 34a304b..91cfa58 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -1247,7 +1247,7 @@ test_file_freespace(void)
free_space = H5Fget_freespace(file);
CHECK(free_space, FAIL, "H5Fget_freespace");
#ifdef H5_HAVE_LARGE_HSIZET
- VERIFY(free_space, 2368, "H5Fget_freespace");
+ VERIFY(free_space, 2376, "H5Fget_freespace");
#else /* H5_HAVE_LARGE_HSIZET */
VERIFY(free_space, 588, "H5Fget_freespace"); /* XXX: fix me */
#endif /* H5_HAVE_LARGE_HSIZET */