diff options
author | Jacob Smith <jake.smith@hdfgroup.org> | 2018-12-12 19:39:14 (GMT) |
---|---|---|
committer | Jacob Smith <jake.smith@hdfgroup.org> | 2018-12-12 23:26:08 (GMT) |
commit | ea7332525010ef75e27ce5800cf65dd91ba43576 (patch) | |
tree | 19f440d677555c016dacc4a2cd28aaa80961e350 /test/accum.c | |
parent | 496de6922fb13aa11a5c5efe56a3f8de157a77ad (diff) | |
parent | 6f52793adcd5a14aa63731e3c33c9737b5a04d16 (diff) | |
download | hdf5-ea7332525010ef75e27ce5800cf65dd91ba43576.zip hdf5-ea7332525010ef75e27ce5800cf65dd91ba43576.tar.gz hdf5-ea7332525010ef75e27ce5800cf65dd91ba43576.tar.bz2 |
Merge branch 'develop' into dset_ohdr_minimize
Diffstat (limited to 'test/accum.c')
-rw-r--r-- | test/accum.c | 55 |
1 files changed, 34 insertions, 21 deletions
diff --git a/test/accum.c b/test/accum.c index 19006b6..87628d8 100644 --- a/test/accum.c +++ b/test/accum.c @@ -23,6 +23,7 @@ #include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" +#include "H5VLprivate.h" /* Virtual Object Layer */ /* Filename */ #define FILENAME "accum.h5" @@ -90,21 +91,30 @@ main(void) unsigned nerrors = 0; /* track errors */ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t fid = -1; + hid_t fapl = -1; /* File access property list */ H5F_t * f = NULL; /* File for all tests */ /* Test Setup */ puts("Testing the metadata accumulator"); + /* File access property list */ + if((fapl = h5_fileaccess()) < 0) + FAIL_STACK_ERROR + /* Create a test file */ - if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR + + /* Closing and remove the file */ + if(H5Pclose(fapl) < 0) + FAIL_STACK_ERROR /* Push API context */ if(H5CX_push() < 0) FAIL_STACK_ERROR api_ctx_pushed = TRUE; /* Get H5F_t * to internal file structure */ - if(NULL == (f = (H5F_t *)H5I_object(fid))) FAIL_STACK_ERROR + if(NULL == (f = (H5F_t *)H5VL_object(fid))) FAIL_STACK_ERROR /* We'll be writing lots of garbage data, so extend the file a ways. 10MB should do. */ @@ -1846,11 +1856,11 @@ test_swmr_write_big(hbool_t newest_format) * by the environment variable. */ driver = HDgetenv("HDF5_DRIVER"); - if (!H5FD_supports_swmr_test(driver)) { + if(!H5FD__supports_swmr_test(driver)) { SKIPPED(); HDputs(" Test skipped due to VFD not supporting SWMR I/O."); return 0; - } /* end if */ + } /* File access property list */ if((fapl = h5_fileaccess()) < 0) @@ -1863,7 +1873,8 @@ test_swmr_write_big(hbool_t newest_format) if((fid = H5Fcreate(SWMR_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR - } else { /* non-latest-format */ + } + else { /* non-latest-format */ if((fid = H5Fcreate(SWMR_FILENAME, H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR } /* end if */ @@ -1881,7 +1892,7 @@ test_swmr_write_big(hbool_t newest_format) api_ctx_pushed = TRUE; /* Get H5F_t * to internal file structure */ - if(NULL == (rf = (H5F_t *)H5I_object(fid))) FAIL_STACK_ERROR + if(NULL == (rf = (H5F_t *)H5VL_object(fid))) FAIL_STACK_ERROR /* We'll be writing lots of garbage data, so extend the file a ways. 10MB should do. */ @@ -1951,10 +1962,11 @@ test_swmr_write_big(hbool_t newest_format) if((pid = HDfork()) < 0) { HDperror("fork"); FAIL_STACK_ERROR; - } else if(0 == pid) { /* Child process */ + } + else if(0 == pid) { /* Child process */ /* Run the reader */ status = HDexecv(SWMR_READER, new_argv); - printf("errno from execv = %s\n", strerror(errno)); + HDprintf("errno from execv = %s\n", strerror(errno)); FAIL_STACK_ERROR; } /* end if */ @@ -2030,18 +2042,19 @@ accum_printf(const H5F_t *f) { H5F_meta_accum_t * accum = &f->shared->accum; - printf("\n"); - printf("Current contents of accumulator:\n"); - if (accum->alloc_size == 0) { - printf("=====================================================\n"); - printf(" No accumulator allocated.\n"); - printf("=====================================================\n"); - } else { - printf("=====================================================\n"); - printf(" accumulator allocated size == %zu\n", accum->alloc_size); - printf(" accumulated data size == %zu\n", accum->size); + HDprintf("\n"); + HDprintf("Current contents of accumulator:\n"); + if(accum->alloc_size == 0) { + HDprintf("=====================================================\n"); + HDprintf(" No accumulator allocated.\n"); + HDprintf("=====================================================\n"); + } + else { + HDprintf("=====================================================\n"); + HDprintf(" accumulator allocated size == %zu\n", accum->alloc_size); + HDprintf(" accumulated data size == %zu\n", accum->size); HDfprintf(stdout, " accumulator dirty? == %t\n", accum->dirty); - printf("=====================================================\n"); + HDprintf("=====================================================\n"); HDfprintf(stdout, " start of accumulated data, loc = %a\n", accum->loc); if(accum->dirty) { HDfprintf(stdout, " start of dirty region, loc = %a\n", (haddr_t)(accum->loc + accum->dirty_off)); @@ -2049,8 +2062,8 @@ accum_printf(const H5F_t *f) } /* end if */ HDfprintf(stdout, " end of accumulated data, loc = %a\n", (haddr_t)(accum->loc + accum->size)); HDfprintf(stdout, " end of accumulator allocation, loc = %a\n", (haddr_t)(accum->loc + accum->alloc_size)); - printf("=====================================================\n"); + HDprintf("=====================================================\n"); } - printf("\n\n"); + HDprintf("\n\n"); } /* accum_printf() */ |