From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: "Petr Vorel" <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [RFC PATCH 1/1] lib: Print tcnt in tst_{brk,res}()
Date: Fri, 20 Mar 2026 09:38:40 +0000 [thread overview]
Message-ID: <69bd15a1.050a0220.27cce5.4d03@mx.google.com> (raw)
In-Reply-To: <20260318144113.30981-1-pvorel@suse.cz>
Hi Petr,
the idea is ok, but there are a few issues in the implementation.
> +static unsigned int tcnt;
`tcnt` is misleading because we are already using the same name inside
`struct tst_test`. Better to use `tcase_idx` or something like this.
>
> struct context {
> int32_t lib_pid;
> @@ -344,7 +345,7 @@ static void print_result(const char *file, const int lineno, int ttype,
print_result() is used everywhere, by any tst_brk, tst_res, tst_vbrk_, tst_cvres
etc. Which means you will have a `tcnt` printed everywhere. It looks better if
we select only the starting message.
>
> if (results_equal(&saved_results, results))
> - tst_brk(TBROK, "Test %i haven't reported results!", i);
> + tst_brk(TBROK, "Test %i haven't reported results!", tcnt);
The new prefix printed by print_result() is 1-indexed (tcnt+1), but this
message body still passes the 0-indexed value. A test skipping its first
case would produce:
tst_test.c:1738: 1 TBROK: Test 0 haven't reported results!
Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-03-20 9:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-18 14:41 [LTP] [RFC PATCH 1/1] lib: Print tcnt in tst_{brk,res}() Petr Vorel
2026-03-20 9:38 ` Andrea Cervesato via ltp [this message]
2026-03-20 11:30 ` Petr Vorel
2026-03-20 11:55 ` Cyril Hrubis
2026-03-20 11:59 ` Cyril Hrubis
2026-03-20 14:18 ` Petr Vorel
2026-03-20 14:37 ` Cyril Hrubis
2026-03-23 13:29 ` Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=69bd15a1.050a0220.27cce5.4d03@mx.google.com \
--to=ltp@lists.linux.it \
--cc=andrea.cervesato@suse.com \
--cc=pvorel@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox