From d6227619a91ad361ff0fb2f1b3b9a9494ee66892 Mon Sep 17 00:00:00 2001 From: vchoi Date: Fri, 9 Apr 2021 15:31:17 -0500 Subject: (1) Remove header files as indicated by PR review comment. (2) Add ifdef for windows as indicated by PR review comment. (3) Misc. cleanup. --- test/vfd_swmr_attrdset_writer.c | 60 ++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/test/vfd_swmr_attrdset_writer.c b/test/vfd_swmr_attrdset_writer.c index 72df4d8..cb0cf67 100644 --- a/test/vfd_swmr_attrdset_writer.c +++ b/test/vfd_swmr_attrdset_writer.c @@ -41,14 +41,11 @@ #define H5F_FRIEND /*suppress error about including H5Fpkg */ #include "hdf5.h" - -#include "H5Fpkg.h" -#include "H5HGprivate.h" -#include "H5VLprivate.h" - #include "testhdf5.h" #include "vfd_swmr_common.h" +#ifndef H5_HAVE_WIN32_API + #define READER_WAIT_TICKS 4 /* Structure to hold info for options specified */ @@ -218,7 +215,7 @@ usage(const char *progname) "-a nattrs: add `nattrs` attributes to all datasets\n" "-d dattrs: delete `dattrs` attributes to all datasets after addition\n" "-u nticks: `nticks` ticks for the reader to wait before verification\n" - " (default is 3)\n" + " (default is 4)\n" "-c csteps: `csteps` steps communication interval between reader and writer\n" " (default is 1)\n" "-S: do not use VFD SWMR\n" @@ -320,6 +317,31 @@ state_init(state_t *s, int argc, char **argv) argc -= optind; argv += optind; + /* Require to specify at least -p, -g or -k option */ + if(!s->compact && !s->contig && !s->chunked) { + printf("Require to specify at least -p, -g or -k option\n"); + usage(s->progname); + goto error; + } + + /* -c cannot be zero */ + if(!s->csteps) { + printf("communication interval cannot be zero\n"); + TEST_ERROR; + } + + /* -c and -a options */ + if(s->asteps && s->csteps > s->asteps) { + printf("communication interval is out of bounds\n"); + TEST_ERROR; + } + + /* -d and -a */ + if(s->dattrs > s->asteps) { + printf("# of attributes to be deleted exceeds # of attributes created\n"); + TEST_ERROR; + } + /* Dataspace for attributes added to datasets */ /* Dataspace for compact and contiguous datasets */ if ((s->one_by_one_sid = H5Screate_simple(1, &dims, &dims)) < 0) { @@ -1737,31 +1759,6 @@ main(int argc, char **argv) TEST_ERROR; } - /* Require to specify at least -p, -g or -k option */ - if(!s.compact && !s.contig && !s.chunked) { - printf("Require to specify at least -p, -g or -k option\n"); - usage(s.progname); - goto error; - } - - /* -c cannot be zero */ - if(!s.csteps) { - printf("communication interval cannot be zero\n"); - TEST_ERROR; - } - - /* -c and -a options */ - if(s.asteps && s.csteps > s.asteps) { - printf("communication interval is out of bounds\n"); - TEST_ERROR; - } - - /* -d and -a */ - if(s.dattrs > s.asteps) { - printf("# of attributes to be deleted exceeds # of attributes created\n"); - TEST_ERROR; - } - personality = strstr(s.progname, "vfd_swmr_attrdset_"); if (personality != NULL && @@ -2015,3 +2012,4 @@ error: return EXIT_FAILURE; } /* main */ +#endif /* H5_HAVE_WIN32_API */ -- cgit v0.12