summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSongyu Lu <songyulu@hdfgroup.org>2021-03-25 22:44:49 (GMT)
committerSongyu Lu <songyulu@hdfgroup.org>2021-03-25 22:44:49 (GMT)
commitfde17589d88ef487fd3fbb487b4a2c98f0da3402 (patch)
tree99470b89f35b96b8a50d44d55132d3d482ab028e /test
parent998aca32e6336bed6286885a03498c78dadfe511 (diff)
parent79a94e0f431ac715d5cc0ca85c144901147207ab (diff)
downloadhdf5-fde17589d88ef487fd3fbb487b4a2c98f0da3402.zip
hdf5-fde17589d88ef487fd3fbb487b4a2c98f0da3402.tar.gz
hdf5-fde17589d88ef487fd3fbb487b4a2c98f0da3402.tar.bz2
Merge branch 'raylu_zoo_test' of https://github.com/HDFGroup/hdf5 into raylu_zoo_test
Diffstat (limited to 'test')
-rw-r--r--test/genall5.c2
-rw-r--r--test/vfd_swmr_zoo_writer.c26
2 files changed, 17 insertions, 11 deletions
diff --git a/test/genall5.c b/test/genall5.c
index de89943..2cb7b9e 100644
--- a/test/genall5.c
+++ b/test/genall5.c
@@ -2754,7 +2754,7 @@ tend_zoo(hid_t fid, const char *base_path, struct timespec *lastmsgtime, zoo_con
out:
if (!ok) {
/* Only the zoo test for VFD SWMR does this step, making sure it doesn't take too long.
- * other tests sets config.msgival to 0 */
+ * Other tests sets config.msgival to 0 and will skip this step */
if (strcmp(failure_mssg, last_failure_mssg) != 0 && ((config.msgival.tv_sec || config.msgival.tv_nsec))) {
if (below_speed_limit(lastmsgtime, &config.msgival)) {
last_failure_mssg = failure_mssg;
diff --git a/test/vfd_swmr_zoo_writer.c b/test/vfd_swmr_zoo_writer.c
index de21bec..06d165d 100644
--- a/test/vfd_swmr_zoo_writer.c
+++ b/test/vfd_swmr_zoo_writer.c
@@ -111,17 +111,19 @@ vfd_swmr_writer_may_increase_tick_to(uint64_t new_tick, bool wait_for_reader)
dbgf(3, "%s: enter\n", __func__);
if (fd == -1) {
- if (access("./shared_tick_num", F_OK ) < 0)
+ if (HDaccess("./shared_tick_num", F_OK ) < 0)
return true;
- fd = open("./shared_tick_num", O_RDONLY);
+ fd = HDopen("./shared_tick_num", O_RDONLY);
if (fd == -1) {
warn("%s: open", __func__); // TBD ratelimit/silence this warning
return true;
}
assert(tick_stats == NULL);
- tick_stats = calloc(1, sizeof(*tick_stats) +
- (swmr_config.max_lag - 1) * sizeof(tick_stats->writer_lead_reader_by[0]));
+ tick_stats = HDcalloc(1, sizeof(*tick_stats) +
+ (swmr_config.max_lag - 1) *
+ sizeof(tick_stats->writer_lead_reader_by[0]));
+
if (tick_stats == NULL)
err(EXIT_FAILURE, "%s: calloc", __func__);
}
@@ -133,7 +135,7 @@ vfd_swmr_writer_may_increase_tick_to(uint64_t new_tick, bool wait_for_reader)
tick_stats->writer_read_shared_file++;
- if ((nread = pread(fd, &shared, sizeof(shared), 0)) == -1)
+ if ((nread = HDpread(fd, &shared, sizeof(shared), 0)) == -1)
err(EXIT_FAILURE, "%s: pread", __func__);
if (nread != sizeof(shared))
@@ -177,7 +179,11 @@ vfd_swmr_reader_did_increase_tick_to(uint64_t new_tick)
if (fd == -1) {
// TBD create a temporary file, here, and move it to its final path
// after writing it.
+<<<<<<< HEAD
fd = open("./shared_tick_num", O_RDWR | O_CREAT, 0600);
+=======
+ fd = HDopen("./shared_tick_num", O_RDWR|O_CREAT, 0600);
+>>>>>>> 79a94e0f431ac715d5cc0ca85c144901147207ab
if (fd == -1)
err(EXIT_FAILURE, "%s: open", __func__);
}
@@ -186,7 +192,7 @@ vfd_swmr_reader_did_increase_tick_to(uint64_t new_tick)
// TBD convert endianness
- if ((nwritten = pwrite(fd, &shared, sizeof(shared), 0)) == -1)
+ if ((nwritten = HDpwrite(fd, &shared, sizeof(shared), 0)) == -1)
errx(EXIT_FAILURE, "%s: pwrite", __func__);
if (nwritten != sizeof(shared))
@@ -268,7 +274,7 @@ main(int argc, char **argv)
case 'l':
/* Expected maximal time for reader's validation of zoo creation or deletion */
errno = 0;
- tmpl = strtoul(optarg, &end, 0);
+ tmpl = HDstrtoul(optarg, &end, 0);
if (end == optarg || *end != '\0')
errx(EXIT_FAILURE, "couldn't parse `-l` argument `%s`", optarg);
else if (errno != 0)
@@ -279,7 +285,7 @@ main(int argc, char **argv)
break;
case 'm':
errno = 0;
- tmpl = strtoul(optarg, &end, 0);
+ tmpl = HDstrtoul(optarg, &end, 0);
if (end == optarg || *end != '\0')
errx(EXIT_FAILURE, "couldn't parse `-m` argument `%s`", optarg);
else if (errno != 0)
@@ -344,10 +350,10 @@ main(int argc, char **argv)
/* Writer creates two named pipes(FIFO) to coordinate two-way communication */
if (writer) {
- if (HDmkfifo(fifo_writer_to_reader, 0666) < 0)
+ if (HDmkfifo(fifo_writer_to_reader, 0600) < 0)
errx(EXIT_FAILURE, "HDmkfifo");
- if (HDmkfifo(fifo_reader_to_writer, 0666) < 0)
+ if (HDmkfifo(fifo_reader_to_writer, 0600) < 0)
errx(EXIT_FAILURE, "HDmkfifo");
}