diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-07-05 20:01:42 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-07-05 20:01:42 (GMT) |
commit | 6930f2e32df5651c66d3bf3e8fea9b6de23b1843 (patch) | |
tree | 1f3429a63977df619ddba6ae3fe1d6486c029b73 | |
parent | b37dc182824c52a9b2c3a634dbe098773d518885 (diff) | |
download | hdf5-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)
-rw-r--r-- | src/H5Omessage.c | 17 | ||||
-rw-r--r-- | test/ohdr.c | 33 |
2 files changed, 37 insertions, 13 deletions
diff --git a/src/H5Omessage.c b/src/H5Omessage.c index 3538db1..799f267 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -1052,17 +1052,14 @@ H5O_msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, /* * Keep track of how many times we failed trying to remove constant * messages. + * (OK to remove constant messages - QAK) */ - if(mesg->flags & H5O_MSG_FLAG_CONSTANT) - udata->nfailed++; - else { - /* Convert message into a null message */ - if(H5O_release_mesg(udata->f, udata->dxpl_id, oh, mesg, udata->adj_link) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to release message") - - /* Indicate that the object header was modified */ - *oh_modified = TRUE; - } /* end else */ + /* Convert message into a null message */ + if(H5O_release_mesg(udata->f, udata->dxpl_id, oh, mesg, udata->adj_link) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to release message") + + /* Indicate that the object header was modified */ + *oh_modified = TRUE; /* Break out now, if we've found the correct message */ if(udata->sequence == H5O_FIRST || udata->sequence != H5O_ALL) 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"; |