summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2021-03-31 15:15:49 (GMT)
committerGitHub <noreply@github.com>2021-03-31 15:15:49 (GMT)
commitdf75d35cc5295b03dc305ca7e5495fece5737d30 (patch)
tree7b8a4754abcb1721e322f50a92c2996d2ed46c2e /test
parent05b0f6745c2025261825a2e478743f141b33d26c (diff)
downloadhdf5-df75d35cc5295b03dc305ca7e5495fece5737d30.zip
hdf5-df75d35cc5295b03dc305ca7e5495fece5737d30.tar.gz
hdf5-df75d35cc5295b03dc305ca7e5495fece5737d30.tar.bz2
Hdf5 merge issue 486 v110 (#490)
* close #195. (#196) * Update HDF5PluginMacros.cmake * Update HDF5PluginMacros.cmake * Modify temporary rpath for testing in java example scripts. (#230) * Fix undefined left shifting of negative numbers (#338) Undefined Bahavior Sanitizer errored here about left shifting negative numbers. * Update license url (#332) * Modify temporary rpath for testing in java example scripts. * Update URL in source file Copyright headers for web copy of COPYING file - src and test directories. * Simplified hl parsing (#399) * Stop using global variables to share parse context with the lexer. The lexer uses an unconventional strategy for parsing lexical categories NUMBER (decimal numbers) and STRING (double-quoted strings) that involves sharing the parse context with the lexer using global variables. There are a couple of problems with that. First, the lexer is too complicated for the simple tokenization it performs—it's hard to tell if it is correct. Second, as @seanm points out, the shared global variables spill into the namespace shared by other libraries and application programs—e.g., VTK. * Regenerate source files from *.[yl]. * Replace strndup, which isn't available on Windows, with a custom routine, `trim_quotes`, that produces a copy of its `const char *` argument with leading and trailing double quotes ('"') removed. While I am here, remove the unnecessary statement `BEGIN INITIAL;`, which I should have deleted in a previous commit. * Regenerate .c from .l. * You haven't programmed in C until you have programmed in High-Definition (HD) C. * \#include "H5private.h" for HD* definitions. * Regenerate *.[ch] from *.[yl]. * Removed workarounds for pre-standard inline keyword (#423) Fixes -Wreserved-identifier warnings due to multiple underscores in H5_HAVE___INLINE. * Replaces checks for fork, etc. with checks for unistd.h (#457) * Replaces checks for fork, etc. with H5_HAVE_UNISTD_H Code previously checked for individual POSIX API calls using H5_HAVE_FORK, etc. The calls we use have been standardized for decades and available via unistd.h. Some test messages that were missing when tests are skipped due to a lack of unistd.h were also added. The configure checks for individual POSIX API calls will be removed in a later commit. * Stupid formatter * Update h5LT files with latest flex and Bison available on jelly (#502) * Modify temporary rpath for testing in java example scripts. * Update URL in source file Copyright headers for web copy of COPYING (license) file. * Add release_docs/code-conventions.md file. * Add script to test h5py. * Fix script error. * Add file h5pytest.yml. * Test declaration of counter variables in for loops. * Committing clang-format changes * Committing clang-format changes * Added [] to line 126 of H5LTanalyze.l. Ran bin/genparser with flex v2.6.4 and Bison v3.0.4 on jelly. * Revert "Added [] to line 126 of H5LTanalyze.l." This reverts commit e4a9cee441efa75b16a8ee030c86189e186dd266. * Revert extra commits to match canonical develop. * Added [] to H5LTanalyze.l line 126 to eliminate warning "rule could not be matched". Ran bin/genparser hl/src with flex v2.6.4 and Bison v3.0.4 on jelly. * Added HD to strdup in H5LTparse.y line 338. Ran bin/genparser hlsrc again. * Removed line 126 from H5LTanalyze.l - previous line matches. Added previously removed line 318 of H5LTparse.y to fix hl_test_lite failure. Ran bin/genparser. Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Add cmake variable HDF5_LIB_INFIX (#7) * Add cmake variable HDF5_LIB_INFIX This infix is added to all library names after 'hdf5'. e.g. the infix '_openmpi' results in the library name 'libhdf5_openmpi.so' This name is used in packages on debian based systems. (see https://packages.debian.org/jessie/amd64/libhdf5-openmpi-8/filelist) This option is useful when testing projects on debian based systems with custom builds of hdf5 while trying to minimize differences between the custom setup and the environment created by installing system packages. * Added RELEASE.txt entry for HDF5_LIB_INFIX. Co-authored-by: Larry Knox <lrknox@hdfgroup.org> * Update test/accum.c to correct merge for replacing checks for fork, etc. with checks for unistd.h (#457) * Committing clang-format changes Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org> Co-authored-by: Sean McBride <sean@rogue-research.com> Co-authored-by: David Young <dyoung@hdfgroup.org> Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Raphael Grimm <barcode@users.noreply.github.com>
Diffstat (limited to 'test')
-rw-r--r--test/accum.c137
-rw-r--r--test/dt_arith.c12
-rw-r--r--test/swmr.c68
-rw-r--r--test/twriteorder.c10
-rw-r--r--test/use_append_chunk.c10
-rw-r--r--test/use_append_chunk_mirror.c10
-rw-r--r--test/use_append_mchunks.c10
-rw-r--r--test/use_common.c8
-rw-r--r--test/use_disable_mdc_flushes.c10
9 files changed, 162 insertions, 113 deletions
diff --git a/test/accum.c b/test/accum.c
index bccfbe7..3658879 100644
--- a/test/accum.c
+++ b/test/accum.c
@@ -2084,33 +2084,30 @@ error:
unsigned
test_swmr_write_big(hbool_t newest_format)
{
+
hid_t fid = -1; /* File ID */
hid_t fapl = -1; /* File access property list */
H5F_t * rf = NULL; /* File pointer */
uint8_t *wbuf2 = NULL, *rbuf = NULL; /* Buffers for reading & writing */
uint8_t wbuf[1024]; /* Buffer for reading & writing */
unsigned u; /* Local index variable */
-#ifdef H5_HAVE_UNISTD_H
- pid_t pid; /* Process ID */
-#endif /* H5_HAVE_UNISTD_H */
- int status; /* Status returned from child process */
- char * new_argv[] = {NULL};
- char * driver = NULL; /* VFD string (from env variable) */
- hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
+ hbool_t process_success = FALSE;
+ char * driver = NULL; /* VFD string (from env variable) */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
if (newest_format)
TESTING("SWMR write of large metadata: with latest format")
else
TESTING("SWMR write of large metadata: with non-latest-format")
-#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID))
+#if !defined(H5_HAVE_UNISTD_H) && !defined(H5_HAVE_WIN32_API)
+ /* Not a Windows or POSIX system */
SKIPPED();
- HDputs(" Test skipped due to fork or waitpid not defined.");
+ HDputs(" Test skipped: Not a Windows or POSIX system.");
return 0;
-#else /* defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID) */
-
+#else
/* Skip this test if SWMR I/O is not supported for the VFD specified
* by the environment variable.
*/
@@ -2219,51 +2216,94 @@ test_swmr_write_big(hbool_t newest_format)
if (HDmemcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0)
TEST_ERROR;
- /* Fork child process to verify that the data at [1024, 2014] does get written to disk */
- if ((pid = HDfork()) < 0) {
- HDperror("fork");
- FAIL_STACK_ERROR;
- }
- else if (0 == pid) { /* Child process */
- /* Run the reader */
- status = HDexecv(SWMR_READER, new_argv);
- HDprintf("errno from execv = %s\n", strerror(errno));
- FAIL_STACK_ERROR;
- } /* end if */
+#if defined(H5_HAVE_WIN32_API)
+ {
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ DWORD exit_code = EXIT_FAILURE;
- /* Parent process -- wait for the child process to complete */
- while (pid != HDwaitpid(pid, &status, 0))
- /*void*/;
+ ZeroMemory(&si, sizeof(si));
+ si.cb = sizeof(si);
+ ZeroMemory(&pi, sizeof(pi));
- /* Check if child process terminates normally and its return value */
- if (WIFEXITED(status) && !WEXITSTATUS(status)) {
- /* Flush the accumulator */
- if (accum_reset(rf) < 0)
+ if (0 == CreateProcess(NULL, SWMR_READER, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
+ HDprintf("CreateProcess failed (%d).\n", GetLastError());
FAIL_STACK_ERROR;
+ }
- /* Close and remove the file */
- if (H5Fclose(fid) < 0)
- FAIL_STACK_ERROR;
+ (void)WaitForSingleObject(pi.hProcess, INFINITE);
+
+ if (FALSE == GetExitCodeProcess(pi.hProcess, &exit_code) || EXIT_FAILURE == exit_code)
+ process_success = FALSE;
+ else
+ process_success = TRUE;
- /* Close the property list */
- if (H5Pclose(fapl) < 0)
+ CloseHandle(pi.hProcess);
+ CloseHandle(pi.hThread);
+ }
+#else /* defined(H5_HAVE_WIN32_API) */
+ {
+ pid_t pid; /* Process ID */
+ int status; /* Status returned from child process */
+
+ /* Fork child process to verify that the data at [1024, 2014] does get written to disk */
+ if ((pid = HDfork()) < 0) {
+ HDperror("fork");
+ FAIL_STACK_ERROR;
+ }
+ else if (0 == pid) { /* Child process */
+ /* By convention, argv[0] tells the name of program invoked.
+ *
+ * execv on NetBSD 8 will actually return EFAULT if there is a
+ * NULL at argv[0], so we follow the convention unconditionally.
+ */
+ char swmr_reader[] = SWMR_READER;
+ char *const new_argv[] = {swmr_reader, NULL};
+ /* Run the reader */
+ status = HDexecv(SWMR_READER, new_argv);
+ HDprintf("errno from execv = %s\n", HDstrerror(errno));
FAIL_STACK_ERROR;
+ } /* end if */
- /* Pop API context */
- if (api_ctx_pushed && H5CX_pop() < 0)
- FAIL_STACK_ERROR
- api_ctx_pushed = FALSE;
+ /* Parent process -- wait for the child process to complete */
+ while (pid != HDwaitpid(pid, &status, 0))
+ /*void*/;
- HDremove(SWMR_FILENAME);
+ /* Check if child process terminates normally and its return value */
+ if (WIFEXITED(status) && !WEXITSTATUS(status))
+ process_success = TRUE;
+ }
+#endif /* defined(H5_HAVE_WIN32_API) */
- /* Release memory */
- if (wbuf2)
- HDfree(wbuf2);
- if (rbuf)
- HDfree(rbuf);
- PASSED();
- return 0;
- } /* end if */
+ /* Check if the process terminated correctly */
+ if (!process_success)
+ FAIL_PUTS_ERROR("child process exited abnormally")
+
+ /* Flush the accumulator */
+ if (accum_reset(rf) < 0)
+ FAIL_STACK_ERROR;
+
+ /* Close and remove the file */
+ if (H5Fclose(fid) < 0)
+ FAIL_STACK_ERROR;
+
+ /* Close the property list */
+ if (H5Pclose(fapl) < 0)
+ FAIL_STACK_ERROR;
+
+ /* Pop API context */
+ if (api_ctx_pushed && H5CX_pop() < 0)
+ FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
+ /* Release memory */
+ if (wbuf2)
+ HDfree(wbuf2);
+ if (rbuf)
+ HDfree(rbuf);
+
+ PASSED();
+ return 0;
error:
/* Closing and remove the file */
@@ -2273,7 +2313,6 @@ error:
H5CX_pop();
H5Pclose(fapl);
- HDremove(SWMR_FILENAME);
/* Release memory */
if (wbuf2)
@@ -2283,7 +2322,7 @@ error:
return 1;
-#endif
+#endif /* !defined(H5_HAVE_UNISTD_H) && !defined(H5_HAVE_WIN32_API) */
} /* end test_swmr_write_big() */
diff --git a/test/dt_arith.c b/test/dt_arith.c
index b2e8374..39f562a 100644
--- a/test/dt_arith.c
+++ b/test/dt_arith.c
@@ -84,7 +84,7 @@ static int skip_overflow_tests_g = 0;
* be allowed to continue (cf. Posix signals) so in order to recover from a
* SIGFPE we run tests that might generate one in a child process.
*/
-#if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)
+#ifdef H5_HAVE_UNISTD_H
#define HANDLE_SIGFPE
#endif
@@ -556,7 +556,7 @@ some_dummy_func(float x)
static void
generates_sigfpe(void)
{
-#if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)
+#ifdef H5_HAVE_UNISTD_H
pid_t pid;
int status;
size_t i, j;
@@ -592,12 +592,12 @@ generates_sigfpe(void)
/* delete the core dump file that SIGFPE may have created */
HDunlink("core");
}
-#else
- HDputs("Cannot determine if floating-point overflows generate a SIGFPE;");
- HDputs("assuming yes.");
+#else /* H5_HAVE_UNISTD_H */
+ HDputs("Cannot determine if floating-point overflows generate a SIGFPE");
+ HDputs("due to a lack of fork(2) - assuming yes.");
HDputs("Overflow cases will not be tested.");
skip_overflow_tests_g = TRUE;
-#endif
+#endif /* H5_HAVE_UNISTD_H */
}
/*-------------------------------------------------------------------------
diff --git a/test/swmr.c b/test/swmr.c
index df30a68..6112b86 100644
--- a/test/swmr.c
+++ b/test/swmr.c
@@ -2340,17 +2340,24 @@ error:
* (5) Parent: open a file with write access; enable SWMR writing mode
* Child: concurrent open of the file with write and SWMR write access (fail)
*/
-#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID))
+#ifndef H5_HAVE_UNISTD_H
static int
-test_start_swmr_write_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t H5_ATTR_UNUSED new_format)
+test_start_swmr_write_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t new_format)
{
+ if (new_format) {
+ TESTING("H5Fstart_swmr_write()--concurrent access for latest format");
+ }
+ else {
+ TESTING("H5Fstart_swmr_write()--concurrent access for non-latest-format");
+ }
+
SKIPPED();
- HDputs(" Test skipped due to fork or waitpid not defined.");
+ HDputs(" Test skipped due to a lack of unistd.h functionality.");
return 0;
} /* test_start_swmr_write_concur() */
-#else /* defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID) */
+#else /* H5_HAVE_UNISTD_H */
static int
test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format)
@@ -2382,7 +2389,7 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format)
}
else {
TESTING("H5Fstart_swmr_write()--concurrent access for non-latest-format");
- } /* end if */
+ }
if ((fapl = H5Pcopy(in_fapl)) < 0)
FAIL_STACK_ERROR
@@ -2943,7 +2950,7 @@ error:
return -1;
} /* test_start_swmr_write_concur() */
-#endif /* !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) */
+#endif /* H5_HAVE_UNISTD_H */
/*
* test_start_swmr_write_stress_ohdr():
@@ -4676,7 +4683,7 @@ error:
** This is for concurrent access.
**
*****************************************************************/
-#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) && defined(H5_HAVE_FLOCK))
+#ifndef H5_HAVE_UNISTD_H
static int
test_file_lock_concur(hid_t H5_ATTR_UNUSED in_fapl)
@@ -4684,12 +4691,12 @@ test_file_lock_concur(hid_t H5_ATTR_UNUSED in_fapl)
/* Output message about test being performed */
TESTING("File open with different combinations of flags--concurrent access");
SKIPPED();
- HDputs(" Test skipped due to fork, waitpid, or flock not defined.");
+ HDputs(" Test skipped due to a lack of unistd.h functionality.");
return 0;
} /* end test_file_lock_concur() */
-#else
+#else /* H5_HAVE_UNISTD_H */
static int
test_file_lock_concur(hid_t in_fapl)
@@ -5047,7 +5054,7 @@ error:
} /* end test_file_lock_concur() */
-#endif /* !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) && defined(H5_HAVE_FLOCK)) */
+#endif /* H5_HAVE_UNISTD_H */
/****************************************************************
**
@@ -5057,7 +5064,7 @@ error:
** This is for concurrent access.
**
*****************************************************************/
-#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID))
+#ifndef H5_HAVE_UNISTD_H
static int
test_file_lock_swmr_concur(hid_t H5_ATTR_UNUSED in_fapl)
@@ -5065,12 +5072,12 @@ test_file_lock_swmr_concur(hid_t H5_ATTR_UNUSED in_fapl)
/* Output message about test being performed */
TESTING("File open with different combintations of flags + SWMR flags--concurrent access");
SKIPPED();
- HDputs(" Test skipped due to fork or waitpid not defined.");
+ HDputs(" Test skipped due to a lack of unistd.h functionality.");
return 0;
} /* end test_file_lock_swmr_concur() */
-#else
+#else /* H5_HAVE_UNISTD_H */
static int
test_file_lock_swmr_concur(hid_t in_fapl)
@@ -6037,7 +6044,7 @@ error:
} /* end test_file_lock_swmr_concur() */
-#endif /* !(defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID)) */
+#endif /* H5_HAVE_UNISTD_H */
/****************************************************************
**
@@ -6049,11 +6056,19 @@ error:
static int
test_file_locking(hid_t in_fapl, hbool_t turn_locking_on, hbool_t env_var_override)
{
-#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID))
+#ifndef H5_HAVE_UNISTD_H
+ if (turn_locking_on && env_var_override)
+ TESTING("File locking: ON w/ env var override")
+ else if (turn_locking_on && !env_var_override)
+ TESTING("File locking: ON")
+ else if (!turn_locking_on && env_var_override)
+ TESTING("File locking: OFF w/ env var override")
+ else
+ TESTING("File locking: OFF")
SKIPPED();
- HDputs(" Test skipped due to fork or waitpid not defined.");
+ HDputs(" Test skipped due to a lack of unistd.h functionality.");
return 0;
-#else
+#else /* H5_HAVE_UNISTD_H */
hid_t fid = -1; /* File ID */
hid_t fapl = -1; /* File access property list */
char filename[NAME_BUF_SIZE]; /* file name */
@@ -6219,7 +6234,7 @@ error:
return -1;
-#endif /* !(defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID)) */
+#endif /* H5_HAVE_UNISTD_H */
} /* end test_file_locking() */
@@ -6499,17 +6514,24 @@ error:
* (7) Refresh the dataset
* (8) Verify the dataset's dimension and data are correct
*/
-#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID))
+#ifndef H5_HAVE_UNISTD_H
static int
-test_refresh_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t H5_ATTR_UNUSED new_format)
+test_refresh_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t new_format)
{
+ if (new_format) {
+ TESTING("H5Drefresh()--concurrent access for latest format");
+ }
+ else {
+ TESTING("H5Drefresh()--concurrent access for non-latest-format");
+ }
+
SKIPPED();
- HDputs(" Test skipped due to fork or waitpid not defined.");
+ HDputs(" Test skipped due to a lack of unistd.h functionality.");
return 0;
} /* test_refresh_concur() */
-#else /* defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID) */
+#else /* H5_HAVE_UNISTD_H */
static int
test_refresh_concur(hid_t in_fapl, hbool_t new_format)
@@ -6809,7 +6831,7 @@ error:
return -1;
} /* test_refresh_concur() */
-#endif /* !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) */
+#endif /* H5_HAVE_UNISTD_H */
/*
* test_multiple_same():
diff --git a/test/twriteorder.c b/test/twriteorder.c
index 4097c80..56b19b6 100644
--- a/test/twriteorder.c
+++ b/test/twriteorder.c
@@ -61,11 +61,9 @@
#include "h5test.h"
/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
+ * Windows.
*/
-#ifdef H5_HAVE_FORK
+#ifdef H5_HAVE_UNISTD_H
#define DATAFILE "twriteorder.dat"
/* #define READERS_MAX 10 */ /* max number of readers */
@@ -468,7 +466,7 @@ done:
return ret_value;
}
-#else /* H5_HAVE_FORK */
+#else /* H5_HAVE_UNISTD_H */
int
main(void)
@@ -477,4 +475,4 @@ main(void)
return EXIT_SUCCESS;
} /* end main() */
-#endif /* H5_HAVE_FORK */
+#endif /* H5_HAVE_UNISTD_H */
diff --git a/test/use_append_chunk.c b/test/use_append_chunk.c
index 3699a56..107615a 100644
--- a/test/use_append_chunk.c
+++ b/test/use_append_chunk.c
@@ -61,11 +61,9 @@
#include "h5test.h"
/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
+ * Windows.
*/
-#ifdef H5_HAVE_FORK
+#ifdef H5_HAVE_UNISTD_H
#include "use.h"
@@ -272,7 +270,7 @@ done:
return (ret_value);
}
-#else /* H5_HAVE_FORK */
+#else /* H5_HAVE_UNISTD_H */
int
main(void)
@@ -281,4 +279,4 @@ main(void)
return EXIT_SUCCESS;
} /* end main() */
-#endif /* H5_HAVE_FORK */
+#endif /* H5_HAVE_UNISTD_H */
diff --git a/test/use_append_chunk_mirror.c b/test/use_append_chunk_mirror.c
index 59a7732..b19c510 100644
--- a/test/use_append_chunk_mirror.c
+++ b/test/use_append_chunk_mirror.c
@@ -91,11 +91,9 @@
#include "use.h"
/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
+ * Windows.
*/
-#ifdef H5_HAVE_FORK
+#ifdef H5_HAVE_UNISTD_H
#ifdef H5_HAVE_MIRROR_VFD
@@ -391,7 +389,7 @@ main(void)
#endif /* H5_HAVE_MIRROR_VFD */
-#else /* H5_HAVE_FORK */
+#else /* H5_HAVE_UNISTD_H */
int
main(void)
@@ -400,4 +398,4 @@ main(void)
return EXIT_SUCCESS;
} /* end main() */
-#endif /* H5_HAVE_FORK */
+#endif /* H5_HAVE_UNISTD_H */
diff --git a/test/use_append_mchunks.c b/test/use_append_mchunks.c
index 705e690..f8fb5e2 100644
--- a/test/use_append_mchunks.c
+++ b/test/use_append_mchunks.c
@@ -53,11 +53,9 @@
#include "h5test.h"
/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
+ * Windows.
*/
-#ifdef H5_HAVE_FORK
+#ifdef H5_HAVE_UNISTD_H
#include "use.h"
@@ -267,7 +265,7 @@ done:
return (ret_value);
} /* end main() */
-#else /* H5_HAVE_FORK */
+#else /* H5_HAVE_UNISTD_H */
int
main(void)
@@ -276,4 +274,4 @@ main(void)
return EXIT_SUCCESS;
} /* end main() */
-#endif /* H5_HAVE_FORK */
+#endif /* H5_HAVE_UNISTD_H */
diff --git a/test/use_common.c b/test/use_common.c
index b407434..d747983 100644
--- a/test/use_common.c
+++ b/test/use_common.c
@@ -13,11 +13,9 @@
#include "h5test.h"
/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
+ * Windows.
*/
-#ifdef H5_HAVE_FORK
+#ifdef H5_HAVE_UNISTD_H
#include "use.h"
@@ -611,4 +609,4 @@ read_uc_file(hbool_t towait, options_t *opts)
return 0;
} /* end read_uc_file() */
-#endif /* H5_HAVE_FORK */
+#endif /* H5_HAVE_UNISTD_H */
diff --git a/test/use_disable_mdc_flushes.c b/test/use_disable_mdc_flushes.c
index 1f2976f..f28e574 100644
--- a/test/use_disable_mdc_flushes.c
+++ b/test/use_disable_mdc_flushes.c
@@ -18,11 +18,9 @@
#include "h5test.h"
/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
+ * Windows.
*/
-#ifdef H5_HAVE_FORK
+#ifdef H5_HAVE_UNISTD_H
#define H5D_FRIEND /*suppress error about including H5Dpkg */
#define H5D_TESTING
@@ -539,7 +537,7 @@ done:
return (ret_value);
}
-#else /* H5_HAVE_FORK */
+#else /* H5_HAVE_UNISTD_H */
int
main(void)
@@ -548,4 +546,4 @@ main(void)
HDexit(EXIT_SUCCESS);
} /* end main() */
-#endif /* H5_HAVE_FORK */
+#endif /* H5_HAVE_UNISTD_H */