summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ohdr.c28
-rw-r--r--test/tsohm.c20
2 files changed, 32 insertions, 16 deletions
diff --git a/test/ohdr.c b/test/ohdr.c
index 905551d..df5f63b 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -60,8 +60,8 @@ test_cont(char *filename, hid_t fapl)
H5O_info_t oinfo;
H5O_loc_t oh_locA, oh_locB;
time_t time_new;
- char *short_name = "T";
- char *long_name = "This is the message";
+ const char *short_name = "T";
+ const char *long_name = "This is the message";
size_t nchunks;
TESTING("object header continuation block");
@@ -100,7 +100,9 @@ test_cont(char *filename, hid_t fapl)
if(H5O_msg_create(&oh_locA, H5O_NAME_ID, 0, 0, &short_name, H5P_DATASET_XFER_DEFAULT) < 0)
FAIL_STACK_ERROR
- if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT, TRUE) < 0)
+ if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT) < 0)
+ FAIL_STACK_ERROR
+ if(H5AC_expunge_entry(f, H5P_DATASET_XFER_DEFAULT, H5AC_OHDR, oh_locA.addr, H5AC__NO_FLAGS_SET) < 0)
FAIL_STACK_ERROR
if(H5O_get_info(&oh_locA, H5P_DATASET_XFER_DEFAULT, FALSE, &oinfo) < 0)
@@ -210,7 +212,9 @@ main(void)
time_new = 11111111;
if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0)
FAIL_STACK_ERROR
- if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT, TRUE) < 0)
+ if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT) < 0)
+ FAIL_STACK_ERROR
+ if(H5AC_expunge_entry(f, H5P_DATASET_XFER_DEFAULT, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
FAIL_STACK_ERROR
if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5P_DATASET_XFER_DEFAULT))
FAIL_STACK_ERROR
@@ -226,7 +230,9 @@ main(void)
time_new = 33333333;
if(H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0)
FAIL_STACK_ERROR
- if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT, TRUE) < 0)
+ if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT) < 0)
+ FAIL_STACK_ERROR
+ if(H5AC_expunge_entry(f, H5P_DATASET_XFER_DEFAULT, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
FAIL_STACK_ERROR
if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5P_DATASET_XFER_DEFAULT))
FAIL_STACK_ERROR
@@ -255,7 +261,9 @@ main(void)
if(H5O_msg_create(&oh_loc, H5O_MTIME_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0)
FAIL_STACK_ERROR
} /* end for */
- if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT, TRUE) < 0)
+ if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT) < 0)
+ FAIL_STACK_ERROR
+ if(H5AC_expunge_entry(f, H5P_DATASET_XFER_DEFAULT, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
FAIL_STACK_ERROR
/* Make certain that chunk #0 in the object header will be encoded with a 2-byte size */
@@ -294,7 +302,9 @@ main(void)
time_new = (i + 1) * 1000 + 10;
if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0)
FAIL_STACK_ERROR
- if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT, TRUE) < 0)
+ if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT) < 0)
+ FAIL_STACK_ERROR
+ if(H5AC_expunge_entry(f, H5P_DATASET_XFER_DEFAULT, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
FAIL_STACK_ERROR
} /* end for */
PASSED();
@@ -322,7 +332,9 @@ main(void)
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)
+ if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT) < 0)
+ FAIL_STACK_ERROR
+ if(H5AC_expunge_entry(f, H5P_DATASET_XFER_DEFAULT, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
FAIL_STACK_ERROR
if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5P_DATASET_XFER_DEFAULT))
FAIL_STACK_ERROR
diff --git a/test/tsohm.c b/test/tsohm.c
index 348677d..b5b489b 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -544,8 +544,12 @@ error:
static hid_t
close_reopen_file(hid_t file, const char* filename, hid_t fapl_id)
{
- if(H5Fclose(file) < 0) goto error;
- return H5Fopen(filename, H5F_ACC_RDWR, fapl_id);
+ hid_t fid;
+
+ if(H5Fclose(file) < 0) FAIL_STACK_ERROR
+ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) < 0) FAIL_STACK_ERROR
+
+ return(fid);
error:
return -1;
@@ -598,19 +602,19 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos
dim1[0] = 1;
if((space_id=H5Screate_simple(1,dim1,NULL)) < 0) TEST_ERROR
- if((dset_id = H5Dcreate2(file,DSETNAME[0],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dset_id = H5Dcreate2(file,DSETNAME[0],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Test writing and reading */
- if(H5Dwrite(dset_id,dtype1_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,&wdata) < 0) TEST_ERROR
+ if(H5Dwrite(dset_id,dtype1_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,&wdata) < 0) FAIL_STACK_ERROR
- if(H5Dread(dset_id,dtype1_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,&rdata) < 0) TEST_ERROR
+ if(H5Dread(dset_id,dtype1_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,&rdata) < 0) FAIL_STACK_ERROR
if(rdata.i1!=wdata.i1 || rdata.i2!=wdata.i2 || HDstrcmp(rdata.str, wdata.str)) {
H5_FAILED(); AT();
printf("incorrect read data\n");
goto error;
} /* end if */
- if(H5Dclose(dset_id) < 0) TEST_ERROR
+ if(H5Dclose(dset_id) < 0) FAIL_STACK_ERROR
/* Close and re-open the file if requested*/
if(test_file_closing) {
@@ -618,8 +622,8 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos
}
/* Create more datasets with the same datatype */
- if((dset_id = H5Dcreate2(file,DSETNAME[1],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Dclose(dset_id) < 0) TEST_ERROR
+ if((dset_id = H5Dcreate2(file,DSETNAME[1],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Dclose(dset_id) < 0) FAIL_STACK_ERROR
/* Close and re-open the file if requested*/
if(test_file_closing) {