summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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";