summaryrefslogtreecommitdiffstats
path: root/test/use_append_chunk.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-09-30 14:27:10 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-09-30 14:27:10 (GMT)
commitb2d661b508a7fc7a2592c13bc6bdc175551f075d (patch)
tree13baeb0d83a7c2a4c6299993c182b1227c2f6114 /test/use_append_chunk.c
parent29ab58b58dce556639ea3154e262895773a8a8df (diff)
downloadhdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.zip
hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.gz
hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.bz2
Clang-format of source files
Diffstat (limited to 'test/use_append_chunk.c')
-rw-r--r--test/use_append_chunk.c51
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 */
-