tests: add `#` when printing call index
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 6 Sep 2024 14:48:23 +0000 (10:48 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Fri, 6 Sep 2024 14:48:41 +0000 (10:48 -0400)
Change-Id: Ibef389b39252444bb1ef1a2f43a629bb8c8277b4
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
tests/test-argpar.c

index 3c4d6bb77b56ac1eff2c37dfacd8bd2287a4c294..e05b01b812147de2e0b0ff6dd73d402ae53bc0e7 100644 (file)
@@ -102,15 +102,15 @@ static void test_succeed(const char * const cmdline, const char * const expected
         status = argpar_iter_next(iter, &item, &error);
 
         ok(status == ARGPAR_ITER_NEXT_STATUS_OK || status == ARGPAR_ITER_NEXT_STATUS_END,
-           "argpar_iter_next() returns the expected status (%d) for command line `%s` (call %u)",
+           "argpar_iter_next() returns the expected status (%d) for command line `%s` (call #%u)",
            status, cmdline, i + 1);
-        ok(!error, "argpar_iter_next() doesn't set an error for command line `%s` (call %u)",
+        ok(!error, "argpar_iter_next() doesn't set an error for command line `%s` (call #%u)",
            cmdline, i + 1);
 
         if (status == ARGPAR_ITER_NEXT_STATUS_END) {
             ok(!item,
                "argpar_iter_next() doesn't set an item for status `ARGPAR_ITER_NEXT_STATUS_END` "
-               "and command line `%s` (call %u)",
+               "and command line `%s` (call #%u)",
                cmdline, i + 1);
             break;
         }
@@ -387,38 +387,38 @@ static void test_fail(const char * const cmdline, const argpar_error_type_t expe
                (status == ARGPAR_ITER_NEXT_STATUS_ERROR &&
                 argpar_error_type(error) == expected_error_type),
            "argpar_iter_next() returns the expected status and error type (%d) "
-           "for command line `%s` (call %u)",
+           "for command line `%s` (call #%u)",
            expected_error_type, cmdline, i + 1);
 
         if (status != ARGPAR_ITER_NEXT_STATUS_OK) {
             ok(!item,
                "argpar_iter_next() doesn't set an item for other status than "
-               "`ARGPAR_ITER_NEXT_STATUS_OK` and command line `%s` (call %u)",
+               "`ARGPAR_ITER_NEXT_STATUS_OK` and command line `%s` (call #%u)",
                cmdline, i + 1);
             ok(error,
                "argpar_iter_next() sets an error for other status than "
-               "`ARGPAR_ITER_NEXT_STATUS_OK` and command line `%s` (call %u)",
+               "`ARGPAR_ITER_NEXT_STATUS_OK` and command line `%s` (call #%u)",
                cmdline, i + 1);
             ok(argpar_error_orig_index(error) == expected_orig_index,
                "argpar_iter_next() sets an error with the expected original argument index "
-               "for command line `%s` (call %u)",
+               "for command line `%s` (call #%u)",
                cmdline, i + 1);
 
             if (argpar_error_type(error) == ARGPAR_ERROR_TYPE_UNKNOWN_OPT) {
                 ok(strcmp(argpar_error_unknown_opt_name(error), expected_unknown_opt_name) == 0,
                    "argpar_iter_next() sets an error with the expected unknown option name "
-                   "for command line `%s` (call %u)",
+                   "for command line `%s` (call #%u)",
                    cmdline, i + 1);
             } else {
                 bool is_short;
 
                 ok(argpar_error_opt_descr(error, &is_short) == &descrs[expected_opt_descr_index],
                    "argpar_iter_next() sets an error with the expected option descriptor "
-                   "for command line `%s` (call %u)",
+                   "for command line `%s` (call #%u)",
                    cmdline, i + 1);
                 ok(is_short == expected_is_short,
                    "argpar_iter_next() sets an error with the expected option type "
-                   "for command line `%s` (call %u)",
+                   "for command line `%s` (call #%u)",
                    cmdline, i + 1);
             }
             break;
@@ -426,11 +426,11 @@ static void test_fail(const char * const cmdline, const argpar_error_type_t expe
 
         ok(item,
            "argpar_iter_next() sets an item for status `ARGPAR_ITER_NEXT_STATUS_OK` "
-           "and command line `%s` (call %u)",
+           "and command line `%s` (call #%u)",
            cmdline, i + 1);
         ok(!error,
            "argpar_iter_next() doesn't set an error for status `ARGPAR_ITER_NEXT_STATUS_OK` "
-           "and command line `%s` (call %u)",
+           "and command line `%s` (call #%u)",
            cmdline, i + 1);
     }
 
This page took 0.025112 seconds and 4 git commands to generate.