- status = argpar_iter_parse_next(iter, &item, &error);
-
- ok(status == ARGPAR_ITER_PARSE_NEXT_STATUS_OK ||
- status == ARGPAR_ITER_PARSE_NEXT_STATUS_ERROR ||
- status == ARGPAR_ITER_PARSE_NEXT_STATUS_ERROR_UNKNOWN_OPT,
- "argpar_iter_parse_next() for command line `%s` call #%u: status", cmdline, i);
-
- if (status != ARGPAR_ITER_PARSE_NEXT_STATUS_OK) {
- ok(!item, "argpar_iter_parse_next() for command line `%s` call #%u: no item returned", cmdline, i);
- ok(error, "argpar_iter_parse_next() for command line `%s` call #%u: error returned", cmdline, i);
+ status = argpar_iter_next(iter, &item, &error);
+ ok(status == ARGPAR_ITER_NEXT_STATUS_OK ||
+ status == expected_status,
+ "argpar_iter_next() returns the expected status "
+ "(%d) for command line `%s` (call %u)",
+ status, 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)",
+ 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)",
+ cmdline, i + 1);