Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH] pty03: Calculate test case count from test case array length
@ 2026-04-24 13:26 Martin Doucha
  2026-04-24 13:45 ` [LTP] " linuxtestproject.agent
  2026-04-25  6:11 ` [LTP] [PATCH] " Li Wang
  0 siblings, 2 replies; 3+ messages in thread
From: Martin Doucha @ 2026-04-24 13:26 UTC (permalink / raw)
  To: ltp

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-25  6:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-24 13:26 [LTP] [PATCH] pty03: Calculate test case count from test case array length Martin Doucha
2026-04-24 13:45 ` [LTP] " linuxtestproject.agent
2026-04-25  6:11 ` [LTP] [PATCH] " Li Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox