summaryrefslogtreecommitdiffstats
path: root/test/ohdr.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-07-05 20:01:42 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-07-05 20:01:42 (GMT)
commit6930f2e32df5651c66d3bf3e8fea9b6de23b1843 (patch)
tree1f3429a63977df619ddba6ae3fe1d6486c029b73 /test/ohdr.c
parentb37dc182824c52a9b2c3a634dbe098773d518885 (diff)
downloadhdf5-6930f2e32df5651c66d3bf3e8fea9b6de23b1843.zip
hdf5-6930f2e32df5651c66d3bf3e8fea9b6de23b1843.tar.gz
hdf5-6930f2e32df5651c66d3bf3e8fea9b6de23b1843.tar.bz2
[svn-r13945] Description:
Modify semantics for constant messages slightly, to allow them to be deleted, but not modified. This works around the issue where "old" style groups are being created with the symbol table message marked constant in the 1.6 (and prior) branch, but the 1.8 branch needs to remove the symbol table message when the group has been changed to the "new" style (upon insertion of a link that the "old" style can't handle). Tested on: Mac OS X/32 10.4.10 (amazon) Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'test/ohdr.c')
-rw-r--r--test/ohdr.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/test/ohdr.c b/test/ohdr.c
index a1d84a7..35ea335 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -73,6 +73,7 @@ main(void)
int i;
hbool_t b; /* Index for "new format" loop */
const char *envval = NULL;
+ herr_t ret; /* Generic return value */
/* Reset library */
h5_reset();
@@ -83,9 +84,9 @@ main(void)
for(b = FALSE; b <= TRUE; b++) {
/* Display info about testing */
if(b)
- HDputs("Using new file format");
+ HDputs("Using new file format:");
else
- HDputs("Using default file format");
+ HDputs("Using default file format:");
/* Set the format to use for the file */
if (H5Pset_latest_format(fapl, b) < 0) FAIL_STACK_ERROR
@@ -188,6 +189,7 @@ main(void)
oh_loc.file = f;
if(H5O_open(&oh_loc) < 0)
FAIL_STACK_ERROR
+ PASSED();
} /* end if */
else {
SKIPPED();
@@ -223,6 +225,31 @@ main(void)
PASSED();
+ /*
+ * Constant message handling.
+ * (can't write to them, but should be able to remove them)
+ */
+ TESTING("constant message handling");
+ time_new = 22222222;
+ if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, H5O_MSG_FLAG_CONSTANT, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0)
+ FAIL_STACK_ERROR
+ if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT, TRUE) < 0)
+ FAIL_STACK_ERROR
+ if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5P_DATASET_XFER_DEFAULT))
+ FAIL_STACK_ERROR
+ if(ro != time_new)
+ TEST_ERROR
+ time_new = 33333333;
+ H5E_BEGIN_TRY {
+ ret = H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT);
+ } H5E_END_TRY;
+ if(ret >= 0)
+ TEST_ERROR
+ if(H5O_msg_remove(&oh_loc, H5O_MTIME_NEW_ID, H5O_ALL, TRUE, H5P_DATASET_XFER_DEFAULT) < 0)
+ FAIL_STACK_ERROR
+ PASSED();
+
+
/* release resources */
TESTING("object header closing");
if(H5O_close(&oh_loc) < 0)
@@ -231,7 +258,7 @@ main(void)
/* Test reading datasets with undefined object header messages */
- TESTING("reading objects with unknown header messages");
+ HDputs("Accessing objects with unknown header messages:");
envval = HDgetenv("HDF5_DRIVER");
if(envval == NULL)
envval = "nomatch";