]> git.ozlabs.org Git - ccan/blobdiff - ccan/opt/test/run-correct-reporting.c
base64: fix for unsigned chars (e.g. ARM).
[ccan] / ccan / opt / test / run-correct-reporting.c
index 4f775a29c47fb0fa819417a0690c01a294034cd9..0c4f6c8693972b489440feddd1a38b260a8011f9 100644 (file)
@@ -10,7 +10,7 @@
 
 int main(int argc, char *argv[])
 {
-       plan_tests(12);
+       plan_tests(14);
 
        /* --aaa without args. */
        opt_register_arg("-a|--aaa", test_arg, NULL, "aaa", "");
@@ -42,6 +42,12 @@ int main(int argc, char *argv[])
        free(err_output);
        err_output = NULL;
 
+       opt_register_noarg("-d", test_noarg, NULL, "");
+       ok1(!parse_args(&argc, &argv, "-dc", NULL));
+       ok1(strstr(err_output, ": -c: requires an argument"));
+
+       /* parse_args allocates argv */
+       free(argv);
        return exit_status();
 }