]> git.draconx.ca Git - cdecl99.git/blobdiff - t/randomdecl.c
tests: Consolidate error messaging a bit.
[cdecl99.git] / t / randomdecl.c
index 177f553a278c6e73e0ca149138637f1bd90c444b..156e51c4842ba4ea4e375cc92651b97eb9c8e761 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Generate random C declarations for testing.
- * Copyright © 2012, 2020, 2022-2023 Nick Bowler
+ * Copyright © 2012, 2020, 2022-2024 Nick Bowler
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #include <stdbool.h>
 #include <errno.h>
 #include <getopt.h>
-#include <cdecl.h>
 
+#include "cdecl.h"
 #include "declgen.h"
-#include "test.h"
 
 #define PROGNAME "randomdecl"
-static const char *progname = PROGNAME;
+#include "test.h"
+
 static const char sopts[] = "s:n:ECVH";
 static const struct option lopts[] = {
        { "seed",    1, NULL, 's' },
@@ -137,7 +137,7 @@ int main(int argc, char **argv)
        }
 
        if (count_str && !test_strtoul(&count, count_str)) {
-               fprintf(stderr, "%s: invalid count: %s\n", progname, count_str);
+               print_error("invalid count: %s", count_str);
                return EXIT_FAILURE;
        }