From f213ff673d10e1782b032c98340e4cccde7542f3 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 9 Mar 2021 19:16:38 -0800 Subject: Windows cleanup * A splitter VFD test in vfd.c fails * Several vfd_swmr.c tests are #ifdef'd around --- test/genall5.c | 124 ++++++++++++++++++++++++------------------------- test/genall5.h | 62 ++++++++++++++++--------- test/vfd_swmr.c | 4 ++ test/vfd_swmr_common.c | 11 +++-- test/vfd_swmr_common.h | 13 ++---- 5 files changed, 116 insertions(+), 98 deletions(-) diff --git a/test/genall5.c b/test/genall5.c index 31b5b87..cac4542 100644 --- a/test/genall5.c +++ b/test/genall5.c @@ -31,25 +31,25 @@ typedef enum phase {PHASE_CREATE, PHASE_VALIDATE, PHASE_DELETE, PHASE_VALIDATE_DELETION} phase_t; -static bool rm_ns_grp_0(hid_t, const char *); -static bool rm_ns_grp_c(hid_t, const char *, unsigned); -static bool rm_ns_grp_d(hid_t, const char *, unsigned); -static bool rm_os_grp_0(hid_t, const char *); -static bool rm_os_grp_n(hid_t, const char *, int, unsigned); -static bool rm_ds_ctg_i(hid_t, const char *, hbool_t); -static bool rm_ds_chk_i(hid_t, const char *, hbool_t); -static bool rm_ds_cpt_i(hid_t, const char *, hbool_t); -static bool rm_ds_ctg_v(hid_t, const char *, hbool_t); - -static bool missing_ns_grp_0(hid_t, const char *); -static bool missing_ns_grp_c(hid_t, const char *, unsigned); -static bool missing_ns_grp_d(hid_t, const char *, unsigned); -static bool missing_os_grp_0(hid_t, const char *); -static bool missing_os_grp_n(hid_t, const char *, int, unsigned); -static bool missing_ds_ctg_i(hid_t, const char *, hbool_t); -static bool missing_ds_chk_i(hid_t, const char *, hbool_t); -static bool missing_ds_cpt_i(hid_t, const char *, hbool_t); -static bool missing_ds_ctg_v(hid_t, const char *, hbool_t); +static hbool_t rm_ns_grp_0(hid_t, const char *); +static hbool_t rm_ns_grp_c(hid_t, const char *, unsigned); +static hbool_t rm_ns_grp_d(hid_t, const char *, unsigned); +static hbool_t rm_os_grp_0(hid_t, const char *); +static hbool_t rm_os_grp_n(hid_t, const char *, int, unsigned); +static hbool_t rm_ds_ctg_i(hid_t, const char *, hbool_t); +static hbool_t rm_ds_chk_i(hid_t, const char *, hbool_t); +static hbool_t rm_ds_cpt_i(hid_t, const char *, hbool_t); +static hbool_t rm_ds_ctg_v(hid_t, const char *, hbool_t); + +static hbool_t missing_ns_grp_0(hid_t, const char *); +static hbool_t missing_ns_grp_c(hid_t, const char *, unsigned); +static hbool_t missing_ns_grp_d(hid_t, const char *, unsigned); +static hbool_t missing_os_grp_0(hid_t, const char *); +static hbool_t missing_os_grp_n(hid_t, const char *, int, unsigned); +static hbool_t missing_ds_ctg_i(hid_t, const char *, hbool_t); +static hbool_t missing_ds_chk_i(hid_t, const char *, hbool_t); +static hbool_t missing_ds_cpt_i(hid_t, const char *, hbool_t); +static hbool_t missing_ds_ctg_v(hid_t, const char *, hbool_t); #define FN_ITEM_DEFN(__name, ...) \ typedef bool (*__name##fn_t)(__VA_ARGS__); \ @@ -68,7 +68,7 @@ FN_ITEM_DEFN(ds_ctg_v, hid_t, const char *, bool); #undef FN_ITEM_DEFN -static bool +static hbool_t file_has_no_path(hid_t fid, const char *path) { switch (H5Lexists(fid, path, H5P_DEFAULT)) { @@ -83,7 +83,7 @@ file_has_no_path(hid_t fid, const char *path) } } -static bool +static hbool_t remove_from_file_path(hid_t fid, const char *path) { if (H5Ldelete(fid, path, H5P_DEFAULT) < 0) { @@ -110,19 +110,19 @@ remove_from_file_path(hid_t fid, const char *path) *------------------------------------------------------------------------- */ -static bool +static hbool_t missing_ns_grp_0(hid_t fid, const char *group_name) { return file_has_no_path(fid, group_name); } -static bool +static hbool_t rm_ns_grp_0(hid_t fid, const char *group_name) { return remove_from_file_path(fid, group_name); } -bool +hbool_t ns_grp_0(hid_t fid, const char *group_name) { hid_t gid = -1; @@ -185,7 +185,7 @@ ns_grp_0(hid_t fid, const char *group_name) *------------------------------------------------------------------------- */ -bool +hbool_t vrfy_ns_grp_0(hid_t fid, const char *group_name) { hid_t gid = -1; @@ -275,20 +275,20 @@ vrfy_ns_grp_0(hid_t fid, const char *group_name) *------------------------------------------------------------------------- */ -static bool +static hbool_t missing_ns_grp_c(hid_t fid, const char *group_name, unsigned H5_ATTR_UNUSED nlinks) { return file_has_no_path(fid, group_name); } -static bool +static hbool_t rm_ns_grp_c(hid_t fid, const char *group_name, unsigned H5_ATTR_UNUSED nlinks) { return remove_from_file_path(fid, group_name); } -bool +hbool_t ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) { hid_t gid = -1; @@ -401,7 +401,7 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) *------------------------------------------------------------------------- */ -bool +hbool_t vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) { hid_t gid = -1; @@ -623,20 +623,20 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) *------------------------------------------------------------------------- */ -static bool +static hbool_t missing_ns_grp_d(hid_t fid, const char *group_name, unsigned H5_ATTR_UNUSED nlinks) { return file_has_no_path(fid, group_name); } -static bool +static hbool_t rm_ns_grp_d(hid_t fid, const char *group_name, unsigned H5_ATTR_UNUSED nlinks) { return remove_from_file_path(fid, group_name); } -bool +hbool_t ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) { hid_t gid = -1; @@ -748,7 +748,7 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) */ -bool +hbool_t vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) { hid_t gid = -1; @@ -967,19 +967,19 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) *------------------------------------------------------------------------- */ -static bool +static hbool_t missing_os_grp_0(hid_t fid, const char *group_name) { return file_has_no_path(fid, group_name); } -static bool +static hbool_t rm_os_grp_0(hid_t fid, const char *group_name) { return remove_from_file_path(fid, group_name); } -bool +hbool_t os_grp_0(hid_t fid, const char *group_name) { hid_t gid = -1; @@ -1053,7 +1053,7 @@ os_grp_0(hid_t fid, const char *group_name) *------------------------------------------------------------------------- */ -bool +hbool_t vrfy_os_grp_0(hid_t fid, const char *group_name) { hid_t gid = -1; @@ -1141,21 +1141,21 @@ vrfy_os_grp_0(hid_t fid, const char *group_name) *------------------------------------------------------------------------- */ -static bool +static hbool_t missing_os_grp_n(hid_t fid, const char *group_name, int H5_ATTR_UNUSED proc_num, unsigned H5_ATTR_UNUSED nlinks) { return file_has_no_path(fid, group_name); } -static bool +static hbool_t rm_os_grp_n(hid_t fid, const char *group_name, int H5_ATTR_UNUSED proc_num, unsigned H5_ATTR_UNUSED nlinks) { return remove_from_file_path(fid, group_name); } -bool +hbool_t os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) { hid_t gid = -1; @@ -1253,7 +1253,7 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) * *------------------------------------------------------------------------- */ -bool +hbool_t vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) { hid_t gid = -1; @@ -1431,20 +1431,20 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) * *------------------------------------------------------------------------- */ -static bool +static hbool_t missing_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t H5_ATTR_UNUSED write_data) { return file_has_no_path(fid, dset_name); } -static bool +static hbool_t rm_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t H5_ATTR_UNUSED write_data) { return remove_from_file_path(fid, dset_name); } -bool +hbool_t ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) { int *wdata = NULL; @@ -1525,7 +1525,7 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) * *------------------------------------------------------------------------- */ -bool +hbool_t vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) { int *rdata = NULL; @@ -1693,20 +1693,20 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) * *------------------------------------------------------------------------- */ -static bool +static hbool_t missing_ds_chk_i(hid_t fid, const char *dset_name, hbool_t H5_ATTR_UNUSED write_data) { return file_has_no_path(fid, dset_name); } -static bool +static hbool_t rm_ds_chk_i(hid_t fid, const char *dset_name, hbool_t H5_ATTR_UNUSED write_data) { return remove_from_file_path(fid, dset_name); } -bool +hbool_t ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) { int *wdata = NULL; @@ -1808,7 +1808,7 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) * *------------------------------------------------------------------------- */ -bool +hbool_t vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) { int *rdata = NULL; @@ -1983,20 +1983,20 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) * *------------------------------------------------------------------------- */ -static bool +static hbool_t missing_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t H5_ATTR_UNUSED write_data) { return file_has_no_path(fid, dset_name); } -static bool +static hbool_t rm_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t H5_ATTR_UNUSED write_data) { return remove_from_file_path(fid, dset_name); } -bool +hbool_t ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) { int *wdata = NULL; @@ -2099,7 +2099,7 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) * *------------------------------------------------------------------------- */ -bool +hbool_t vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) { int *rdata = NULL; @@ -2262,20 +2262,20 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) * *------------------------------------------------------------------------- */ -static bool +static hbool_t missing_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t H5_ATTR_UNUSED write_data) { return file_has_no_path(fid, dset_name); } -static bool +static hbool_t rm_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t H5_ATTR_UNUSED write_data) { return remove_from_file_path(fid, dset_name); } -bool +hbool_t ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) { hid_t dsid = -1; @@ -2400,7 +2400,7 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) * *------------------------------------------------------------------------- */ -bool +hbool_t vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) { hid_t dsid = -1; @@ -2601,7 +2601,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) * Return `true` if the selector was valid, `false` if it was not. */ -static bool +static hbool_t create_or_validate_selection(hid_t fid, const char *full_path, int selector, zoo_config_t config, phase_t phase, bool *okp) { @@ -2776,7 +2776,7 @@ out: *------------------------------------------------------------------------- */ -bool +hbool_t create_zoo(hid_t fid, const char *base_path, struct timespec *lastmsgtime, zoo_config_t config) { @@ -2804,7 +2804,7 @@ create_zoo(hid_t fid, const char *base_path, struct timespec *lastmsgtime, *------------------------------------------------------------------------- */ -bool +hbool_t validate_zoo(hid_t fid, const char *base_path, struct timespec *lastmsgtime, zoo_config_t config) { @@ -2813,7 +2813,7 @@ validate_zoo(hid_t fid, const char *base_path, struct timespec *lastmsgtime, return tend_zoo(fid, base_path, lastmsgtime, config, phase, NELMTS(phase)); } -bool +hbool_t delete_zoo(hid_t fid, const char *base_path, struct timespec *lastmsgtime, zoo_config_t config) { @@ -2822,7 +2822,7 @@ delete_zoo(hid_t fid, const char *base_path, struct timespec *lastmsgtime, return tend_zoo(fid, base_path, lastmsgtime, config, phase, NELMTS(phase)); } -bool +hbool_t validate_deleted_zoo(hid_t fid, const char *base_path, struct timespec *lastmsgtime, zoo_config_t config) { diff --git a/test/genall5.h b/test/genall5.h index 43fe15d..2c37b50 100644 --- a/test/genall5.h +++ b/test/genall5.h @@ -15,6 +15,9 @@ * This file contains declarations of all functions defined in genall5.c */ +#ifndef GENALL5_H +#define GENALL5_H + typedef struct _zoo_config { int proc_num; bool continue_on_failure; @@ -26,43 +29,56 @@ typedef struct _zoo_config { */ } zoo_config_t; -bool create_zoo(hid_t, const char *, struct timespec *, zoo_config_t); -bool validate_zoo(hid_t, const char *, struct timespec *, zoo_config_t); -bool delete_zoo(hid_t, const char *, struct timespec *, zoo_config_t); -bool validate_deleted_zoo(hid_t, const char *, struct timespec *, +/**************/ +/* Prototypes */ +/**************/ +#ifdef __cplusplus +extern "C" { +#endif + +H5TEST_DLL hbool_t create_zoo(hid_t, const char *, struct timespec *, zoo_config_t); +H5TEST_DLL hbool_t validate_zoo(hid_t, const char *, struct timespec *, zoo_config_t); +H5TEST_DLL hbool_t delete_zoo(hid_t, const char *, struct timespec *, zoo_config_t); +H5TEST_DLL hbool_t validate_deleted_zoo(hid_t, const char *, struct timespec *, zoo_config_t); -bool ns_grp_0(hid_t fid, const char *group_name); -bool vrfy_ns_grp_0(hid_t fid, const char *group_name); +H5TEST_DLL hbool_t ns_grp_0(hid_t fid, const char *group_name); +H5TEST_DLL hbool_t vrfy_ns_grp_0(hid_t fid, const char *group_name); -bool ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks); -bool vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks); +H5TEST_DLL hbool_t ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks); +H5TEST_DLL hbool_t vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks); -bool ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks); -bool vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks); +H5TEST_DLL hbool_t ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks); +H5TEST_DLL hbool_t vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks); -bool os_grp_0(hid_t fid, const char *group_name); -bool vrfy_os_grp_0(hid_t fid, const char *group_name); +H5TEST_DLL hbool_t os_grp_0(hid_t fid, const char *group_name); +H5TEST_DLL hbool_t vrfy_os_grp_0(hid_t fid, const char *group_name); -bool os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks); -bool vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, +H5TEST_DLL hbool_t os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks); +H5TEST_DLL hbool_t vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks); -bool ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data); -bool vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data); +H5TEST_DLL hbool_t ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data); +H5TEST_DLL hbool_t vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data); -bool ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data); -bool vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data); +H5TEST_DLL hbool_t ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data); +H5TEST_DLL hbool_t vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data); -bool ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data); -bool vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data); +H5TEST_DLL hbool_t ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data); +H5TEST_DLL hbool_t vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data); -bool ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data); -bool vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data); +H5TEST_DLL hbool_t ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data); +H5TEST_DLL hbool_t vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data); /* Individual tests can override zoo_create_hook(), which is called * after each step of create_zoo(). The `hid_t` argument identifies * the file where the step was performed. The test library provides a * default implementation of zoo_create_hook() that does nothing. */ -void zoo_create_hook(hid_t); +H5TEST_DLL void zoo_create_hook(hid_t); + +#ifdef __cplusplus +} +#endif + +#endif /* GENALL5_H */ diff --git a/test/vfd_swmr.c b/test/vfd_swmr.c index b9f2df6..8c5b853 100644 --- a/test/vfd_swmr.c +++ b/test/vfd_swmr.c @@ -3454,13 +3454,17 @@ main(void) nerrors += test_shadow_index_lookup(); nerrors += test_file_fapl(); +#ifndef H5_HAVE_WIN32_API nerrors += test_writer_create_open_flush(); nerrors += test_writer_md(); +#endif nerrors += test_reader_md_concur(); nerrors += test_multiple_file_opens(); nerrors += test_multiple_file_opens_concur(); +#ifndef H5_HAVE_WIN32_API nerrors += test_same_file_opens(); +#endif nerrors += test_enable_disable_eot(); nerrors += test_disable_enable_eot_concur(); diff --git a/test/vfd_swmr_common.c b/test/vfd_swmr_common.c index 82d3517..ea9ab50 100644 --- a/test/vfd_swmr_common.c +++ b/test/vfd_swmr_common.c @@ -23,7 +23,6 @@ #include "vfd_swmr_common.h" #include "swmr_common.h" -#ifndef H5_HAVE_WIN32_API /* Only need the pthread solution if sigtimedwait(2) isn't available. * There's currently no Windows solution, so ignore that for now. @@ -154,6 +153,8 @@ restore_estack(estack_state_t es) (void)H5Eset_auto(H5E_DEFAULT, es.efunc, es.edata); } + +#ifndef H5_HAVE_WIN32_API /* Store the signal mask at `oldset` and then block all signals. */ void block_signals(sigset_t *oldset) @@ -198,7 +199,7 @@ strsignal(int signum) } #endif -#if !defined(H5_HAVE_SIGTIMEDWAIT) && !defined(H5_HAVE_WIN32_API) +#ifndef H5_HAVE_SIGTIMEDWAIT typedef struct timer_params_t { struct timespec *tick; @@ -245,7 +246,7 @@ timer_function(void *arg) return NULL; } -#endif /* !defined(H5_HAVE_SIGTIMEDWAIT) && !defined(H5_HAVE_WIN32_API) */ +#endif /* H5_HAVE_SIGTIMEDWAIT */ /* Wait for any signal to occur and then return. Wake periodically * during the wait to perform API calls: in this way, the @@ -336,6 +337,8 @@ await_signal(hid_t fid) #endif /* H5_HAVE_SIGTIMEDWAIT */ } +#endif /* H5_HAVE_WIN32_API */ + /* Revised support routines that can be used for all VFD SWMR integration tests */ /* Initialize fields in config with the input parameters */ @@ -400,8 +403,6 @@ vfd_swmr_create_fapl(bool use_latest_format, bool use_vfd_swmr, bool only_meta_p } /* vfd_swmr_create_fapl() */ -#endif /* H5_HAVE_WIN32_API */ - /* Fetch a variable from the environment and parse it for unsigned long * content. Return 0 if the variable is not present, -1 if it is present * but it does not parse and compare less than `limit`, 1 if it's present, diff --git a/test/vfd_swmr_common.h b/test/vfd_swmr_common.h index 9e77471..c764df8 100644 --- a/test/vfd_swmr_common.h +++ b/test/vfd_swmr_common.h @@ -53,6 +53,8 @@ typedef enum _testsel { /* Global Variables */ /********************/ +H5TEST_DLLVAR int verbosity; + /**************/ /* Prototypes */ /**************/ @@ -60,18 +62,17 @@ typedef enum _testsel { extern "C" { #endif -#ifndef H5_HAVE_WIN32_API - -H5TEST_DLL bool below_speed_limit(struct timespec *, const struct timespec *); +H5TEST_DLL hbool_t below_speed_limit(struct timespec *, const struct timespec *); H5TEST_DLL estack_state_t estack_get_state(void); H5TEST_DLL estack_state_t disable_estack(void); H5TEST_DLL void restore_estack(estack_state_t); - +#ifndef H5_HAVE_WIN32_API H5TEST_DLL void block_signals(sigset_t *); H5TEST_DLL void restore_signals(sigset_t *); H5TEST_DLL void await_signal(hid_t); +#endif /* H5_HAVE_WIN32_API */ H5TEST_DLL hid_t vfd_swmr_create_fapl(bool use_latest_format, bool use_vfd_swmr, bool only_meta_pages, @@ -87,14 +88,10 @@ H5TEST_DLL void evsnprintf(char *, size_t, const char *, va_list); H5TEST_DLL void esnprintf(char *, size_t, const char *, ...) H5_ATTR_FORMAT(printf, 3, 4); -#endif /* H5_HAVE_WIN32_API */ - H5TEST_DLL int fetch_env_ulong(const char *, unsigned long, unsigned long *); #ifdef __cplusplus } #endif -H5TEST_DLLVAR int verbosity; - #endif /* SWMR_COMMON_H */ -- cgit v0.12