summaryrefslogtreecommitdiffstats
path: root/test/ohdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/ohdr.c')
-rw-r--r--test/ohdr.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/test/ohdr.c b/test/ohdr.c
index d28b11e..60d32b7 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -34,6 +34,13 @@
#define H5G_FRIEND /* suppress error about including H5Gpkg */
#include "H5Gpkg.h"
+/*
+ * This file needs to access private routines from the H5FD package.
+ */
+#define H5FD_FRIEND /* suppress error about including H5FDpkg */
+#define H5FD_TESTING
+#include "H5FDpkg.h"
+
const char *FILENAME[] = {"ohdr", "ohdr_min_a", "ohdr_min_b", NULL};
/* used for object header size comparison */
@@ -1813,13 +1820,12 @@ main(void)
herr_t ret; /* Generic return value */
/* Get the VFD to use */
- env_h5_drvr = HDgetenv("HDF5_DRIVER");
+ env_h5_drvr = HDgetenv(HDF5_DRIVER);
if (env_h5_drvr == NULL)
env_h5_drvr = "nomatch";
/* Check for VFD which stores data in multiple files */
- single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
- HDstrcmp(env_h5_drvr, "family") != 0);
+ single_file_vfd = !h5_driver_uses_multiple_files(env_h5_drvr, 0);
/* Reset library */
h5_reset();
@@ -2107,11 +2113,15 @@ main(void)
if (h5_verify_cached_stabs(FILENAME, fapl) < 0)
TEST_ERROR
- /* A test to exercise the re-read of the object header for SWMR access */
- if (test_ohdr_swmr(TRUE) < 0)
- TEST_ERROR
- if (test_ohdr_swmr(FALSE) < 0)
- TEST_ERROR
+ if (H5FD__supports_swmr_test(env_h5_drvr)) {
+ /* A test to exercise the re-read of the object header for SWMR access */
+ if (test_ohdr_swmr(TRUE) < 0)
+ TEST_ERROR
+ if (test_ohdr_swmr(FALSE) < 0)
+ TEST_ERROR
+ }
+ else
+ HDputs("Skipped SWMR tests for SWMR-incompatible VFD");
/* Pop API context */
if (api_ctx_pushed && H5CX_pop(FALSE) < 0)