Linux Test Project
 help / color / mirror / Atom feed
From: Martin Doucha <mdoucha@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] pty03: Calculate test case count from test case array length
Date: Fri, 24 Apr 2026 15:26:05 +0200	[thread overview]
Message-ID: <20260424132606.61550-1-mdoucha@suse.cz> (raw)

Use ARRAY_SIZE() to calculate test case count so that the number
does not need to be adjusted manually if anyone adds or removes
another line discipline to the list.

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---

The actual test cases start at ldiscs[1]. ldiscs[0] is a special value
for initializing the file descriptor before setting the real line
discipline.

 testcases/kernel/pty/pty03.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/pty/pty03.c b/testcases/kernel/pty/pty03.c
index 99c659264..d4da24265 100644
--- a/testcases/kernel/pty/pty03.c
+++ b/testcases/kernel/pty/pty03.c
@@ -146,7 +146,7 @@ static void cleanup(void)
 
 static struct tst_test test = {
 	.test = do_test,
-	.tcnt = 9,
+	.tcnt = ARRAY_SIZE(ldiscs) - 1,
 	.setup = setup,
 	.cleanup = cleanup,
 	.needs_root = 1,
-- 
2.53.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

             reply	other threads:[~2026-04-24 13:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-24 13:26 Martin Doucha [this message]
2026-04-24 13:45 ` [LTP] pty03: Calculate test case count from test case array length linuxtestproject.agent
2026-04-25  6:11 ` [LTP] [PATCH] " Li Wang

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=20260424132606.61550-1-mdoucha@suse.cz \
    --to=mdoucha@suse.cz \
    --cc=ltp@lists.linux.it \
    /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