summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-05-15 17:20:21 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-05-15 17:20:21 (GMT)
commita2ad44f41901cc5a94d8a17f8bf43bda48986b4c (patch)
treeea6ed816854fe118b745ee4ae7dabe0a2d94f81c
parentad79ca8ae746d1cc7d7a66d48e4d3ee5d47e7b0d (diff)
downloadhdf5-a2ad44f41901cc5a94d8a17f8bf43bda48986b4c.zip
hdf5-a2ad44f41901cc5a94d8a17f8bf43bda48986b4c.tar.gz
hdf5-a2ad44f41901cc5a94d8a17f8bf43bda48986b4c.tar.bz2
Make the personality detection more robust like I did for
vfd_swmr_zoo_writer, previously.
-rw-r--r--test/vfd_swmr_bigset_writer.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/vfd_swmr_bigset_writer.c b/test/vfd_swmr_bigset_writer.c
index ec9bbca..a0e905f 100644
--- a/test/vfd_swmr_bigset_writer.c
+++ b/test/vfd_swmr_bigset_writer.c
@@ -601,15 +601,22 @@ main(int argc, char **argv)
unsigned step, which;
bool writer;
state_t s;
+ const char *personality;
state_init(&s, argc, argv);
- if (strcmp(s.progname, "vfd_swmr_bigset_writer") == 0)
+ personality = strstr(s.progname, "vfd_swmr_bigset_");
+
+ if (personality != NULL &&
+ strcmp(personality, "vfd_swmr_bigset_writer") == 0)
writer = true;
- else if (strcmp(s.progname, "vfd_swmr_bigset_reader") == 0)
+ else if (personality != NULL &&
+ strcmp(personality, "vfd_swmr_bigset_reader") == 0)
writer = false;
- else
- errx(EXIT_FAILURE, "no program personality matches '%s'", s.progname);
+ else {
+ errx(EXIT_FAILURE,
+ "unknown personality, expected vfd_swmr_bigset_{reader,writer}");
+ }
if ((mat = newmat(s.rows, s.cols)) == NULL)
err(EXIT_FAILURE, "%s: could not allocate matrix", __func__);