summaryrefslogtreecommitdiffstats
path: root/test/vfd_swmr_zoo_writer.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-04-23 20:31:56 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-04-23 20:31:56 (GMT)
commita9849089c6838289321a2d6b36d1dd20397cf892 (patch)
treee73d7396c8a576ec53779486e49e553b3c011cf9 /test/vfd_swmr_zoo_writer.c
parentb1e2eceed77fa5dcab8f383cdad3a76d728802a0 (diff)
downloadhdf5-a9849089c6838289321a2d6b36d1dd20397cf892.zip
hdf5-a9849089c6838289321a2d6b36d1dd20397cf892.tar.gz
hdf5-a9849089c6838289321a2d6b36d1dd20397cf892.tar.bz2
Delete dead code. Re-enable the coordination between reader and writer:
the writer expects to read a character on its standard input stream when the reader is ready for it to delete the zoo content.
Diffstat (limited to 'test/vfd_swmr_zoo_writer.c')
-rw-r--r--test/vfd_swmr_zoo_writer.c33
1 files changed, 3 insertions, 30 deletions
diff --git a/test/vfd_swmr_zoo_writer.c b/test/vfd_swmr_zoo_writer.c
index a3e0a08..1a64ac6 100644
--- a/test/vfd_swmr_zoo_writer.c
+++ b/test/vfd_swmr_zoo_writer.c
@@ -220,16 +220,9 @@ main(int argc, char **argv)
int ch;
bool use_vfd_swmr = true;
bool print_estack = false;
-#if 0
- unsigned long tmp;
- char *end;
- int i;
- const struct timespec delay =
- {.tv_sec = 0, .tv_nsec = 1000 * 1000 * 1000 / 10};
-#endif
const char *progname = basename(argv[0]);
estack_state_t es;
-#if 0
+#if 1
char step[2] = "ab";
#endif
@@ -318,26 +311,11 @@ main(int argc, char **argv)
es = print_estack ? estack_get_state() : disable_estack();
if (writer) {
-#if 0
- H5Fvfd_swmr_end_tick(fid);
-
- if (read(STDIN_FILENO, &step[0], sizeof(step[0])) == -1)
- err(EXIT_FAILURE, "read");
-
- if (step[0] != 'a')
- errx(EXIT_FAILURE, "expected 'a' read '%c'", step[0]);
-#endif
-
dbgf(1, "Writing zoo...\n");
if (!create_zoo(fid, ".", config))
errx(EXIT_FAILURE, "create_zoo didn't pass self-check");
-#if 1
- H5Fvfd_swmr_end_tick(fid);
-#endif
-
-#if 0
if (read(STDIN_FILENO, &step[1], sizeof(step[1])) == -1)
err(EXIT_FAILURE, "read");
@@ -346,21 +324,16 @@ main(int argc, char **argv)
if (!delete_zoo(fid, ".", config))
errx(EXIT_FAILURE, "delete_zoo failed");
-#endif
} else {
dbgf(1, "Reading zoo...\n");
-#if 0
- if (write(STDOUT_FILENO, &step[0], sizeof(step[0])) == -1)
- err(EXIT_FAILURE, "write");
-#endif
+
while (!validate_zoo(fid, ".", config))
;
-#if 0
+
if (write(STDOUT_FILENO, &step[1], sizeof(step[1])) == -1)
err(EXIT_FAILURE, "write");
while (!validate_deleted_zoo(fid, ".", config))
;
-#endif
}
restore_estack(es);