From: Simon Marchi Date: Fri, 6 Sep 2024 14:48:23 +0000 (-0400) Subject: tests: add `#` when printing call index X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=3364251abec12da42cb42ce049885248a69ea15b;p=argpar.git tests: add `#` when printing call index Change-Id: Ibef389b39252444bb1ef1a2f43a629bb8c8277b4 Signed-off-by: Simon Marchi --- diff --git a/tests/test-argpar.c b/tests/test-argpar.c index 3c4d6bb..e05b01b 100644 --- a/tests/test-argpar.c +++ b/tests/test-argpar.c @@ -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); }