diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-05-23 20:47:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-23 20:47:24 (GMT) |
commit | 68abd201b2aa56cbc5c7bfee99bcb8d9612eb73a (patch) | |
tree | b57fb9902cbcd2fb9abcdaa7321ec1420060067f /test/swmr.c | |
parent | ee919605677bd89ac7a541b137f048a5596b2899 (diff) | |
download | hdf5-68abd201b2aa56cbc5c7bfee99bcb8d9612eb73a.zip hdf5-68abd201b2aa56cbc5c7bfee99bcb8d9612eb73a.tar.gz hdf5-68abd201b2aa56cbc5c7bfee99bcb8d9612eb73a.tar.bz2 |
Fix missing/misplaced h5_reset calls (#3001)
Fixes failures when running tests after building with thread-safety
w/ code stacks on.
Fixes #2990
Diffstat (limited to 'test/swmr.c')
-rw-r--r-- | test/swmr.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/swmr.c b/test/swmr.c index d3a0d13..4abf779 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -7728,12 +7728,15 @@ error: int main(void) { - int nerrors = 0; /* The # of errors */ - hid_t fapl = -1; /* File access property list ID */ - char *driver = NULL; /* VFD string (from env variable) */ - char *lock_env_var = NULL; /* file locking env var pointer */ - hbool_t use_file_locking; /* read from env var */ - hbool_t file_locking_enabled = FALSE; /* Checks if the file system supports locks */ + int nerrors = 0; /* The # of errors */ + hid_t fapl = H5I_INVALID_HID; /* File access property list ID */ + char *driver = NULL; /* VFD string (from env variable) */ + char *lock_env_var = NULL; /* file locking env var pointer */ + hbool_t use_file_locking; /* read from env var */ + hbool_t file_locking_enabled = FALSE; /* Checks if the file system supports locks */ + + /* Testing setup */ + h5_reset(); /* Skip this test if SWMR I/O is not supported for the VFD specified * by the environment variable. @@ -7742,7 +7745,7 @@ main(void) if (!H5FD__supports_swmr_test(driver)) { HDprintf("This VFD does not support SWMR I/O\n"); return EXIT_SUCCESS; - } /* end if */ + } /* Check the environment variable that determines if we care * about file locking. File locking should be used unless explicitly @@ -7761,9 +7764,6 @@ main(void) return EXIT_FAILURE; } - /* Set up */ - h5_reset(); - /* Get file access property list */ fapl = h5_fileaccess(); @@ -7822,7 +7822,7 @@ main(void) */ nerrors += test_file_lock_swmr_same(fapl); nerrors += test_file_lock_swmr_concur(fapl); - } /* end if */ + } /* Tests SWMR VFD compatibility flag. * Only needs to run when the VFD is the default (sec2). |