diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-10-01 14:04:36 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-10-01 14:04:36 (GMT) |
commit | f1ba03cea5b82699a984c80bd2deac14fdc8df18 (patch) | |
tree | ebe777c3e0b83f4c4cec9212731da9ebe0a0cfd3 /test/use_append_chunk.c | |
parent | 10343c197906415388f2a4c8d292e21d25cf7381 (diff) | |
download | hdf5-f1ba03cea5b82699a984c80bd2deac14fdc8df18.zip hdf5-f1ba03cea5b82699a984c80bd2deac14fdc8df18.tar.gz hdf5-f1ba03cea5b82699a984c80bd2deac14fdc8df18.tar.bz2 |
Source formatted
Diffstat (limited to 'test/use_append_chunk.c')
-rw-r--r-- | test/use_append_chunk.c | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/test/use_append_chunk.c b/test/use_append_chunk.c index 8fcf0d3..349ab24 100644 --- a/test/use_append_chunk.c +++ b/test/use_append_chunk.c @@ -77,23 +77,23 @@ static options_t UC_opts; /* Use Case Options */ * Return: 0 succeed; -1 fail. */ int -setup_parameters(int argc, char * const argv[], options_t * opts) +setup_parameters(int argc, char *const argv[], options_t *opts) { /* use case defaults */ HDmemset(opts, 0, sizeof(options_t)); - opts->chunksize = Chunksize_DFT; - opts->use_swmr = TRUE; /* use swmr open */ - opts->iterations = 1; + opts->chunksize = Chunksize_DFT; + opts->use_swmr = TRUE; /* use swmr open */ + opts->iterations = 1; opts->chunkplanes = 1; - opts->progname = USE_APPEND_CHUNK_PROGNAME; + opts->progname = USE_APPEND_CHUNK_PROGNAME; if (parse_option(argc, argv, opts) < 0) - return(-1); + return (-1); opts->chunkdims[0] = opts->chunkplanes; opts->chunkdims[1] = opts->chunkdims[2] = opts->chunksize; - opts->dims[0] = 0; + opts->dims[0] = 0; opts->max_dims[0] = H5S_UNLIMITED; opts->dims[1] = opts->dims[2] = opts->max_dims[1] = opts->max_dims[2] = opts->chunksize; @@ -101,10 +101,9 @@ setup_parameters(int argc, char * const argv[], options_t * opts) opts->nplanes = (hsize_t)opts->chunksize; show_parameters(opts); - return(0); + return (0); } /* setup_parameters() */ - /* Overall Algorithm: * Parse options from user; * Generate/pre-created test files needed and close it; @@ -115,15 +114,15 @@ setup_parameters(int argc, char * const argv[], options_t * opts) int main(int argc, char *argv[]) { - pid_t childpid=0; - pid_t mypid, tmppid; - int child_status; - int child_wait_option=0; - int ret_value = 0; - int child_ret_value; + pid_t childpid = 0; + pid_t mypid, tmppid; + int child_status; + int child_wait_option = 0; + int ret_value = 0; + int child_ret_value; hbool_t send_wait = FALSE; - hid_t fapl = -1; /* File access property list */ - hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list */ + hid_t fid = -1; /* File ID */ if (setup_parameters(argc, argv, &UC_opts) < 0) { Hgoto_error(1); @@ -156,7 +155,8 @@ main(int argc, char *argv[]) if (create_uc_file(&UC_opts) < 0) { HDfprintf(stderr, "***encounter error\n"); Hgoto_error(1); - } else { + } + else { HDprintf("File created.\n"); } /* Close FAPL to prevent issues with forking later */ @@ -219,7 +219,8 @@ main(int argc, char *argv[]) } } - if ((fid = H5Fopen(UC_opts.filename, H5F_ACC_RDWR | (UC_opts.use_swmr ? H5F_ACC_SWMR_WRITE : 0), fapl)) < 0) { + if ((fid = H5Fopen(UC_opts.filename, H5F_ACC_RDWR | (UC_opts.use_swmr ? H5F_ACC_SWMR_WRITE : 0), fapl)) < + 0) { HDfprintf(stderr, "H5Fopen failed\n"); Hgoto_error(1); } @@ -250,11 +251,11 @@ main(int argc, char *argv[]) if (WIFEXITED(child_status)) { if ((child_ret_value = WEXITSTATUS(child_status)) != 0) { - HDprintf("%d: child process exited with non-zero code (%d)\n", - mypid, child_ret_value); + HDprintf("%d: child process exited with non-zero code (%d)\n", mypid, child_ret_value); Hgoto_error(2); } - } else { + } + else { HDprintf("%d: child process terminated abnormally\n", mypid); Hgoto_error(2); } @@ -263,11 +264,12 @@ main(int argc, char *argv[]) done: if (ret_value != 0) { HDprintf("Error(s) encountered\n"); - } else { + } + else { HDprintf("All passed\n"); } - return(ret_value); + return (ret_value); } #else /* H5_HAVE_FORK */ @@ -280,4 +282,3 @@ main(void) } /* end main() */ #endif /* H5_HAVE_FORK */ - |