pty03: Calculate test case count from test case array length
PATCH 1/1 pty03: Calculate test case count from test case array length
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.
---
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(-)
testcases/kernel/pty/pty03.c +1 -1
@@ -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 ,
Signature · 5 lines
2.53.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Martin,
testcases/kernel/pty/pty03.c static void cleanup(void) · line 149
Quoted 4 lines · Martin Doucha
pty03: Calculate test case count from test case array length
testcases/kernel/pty/pty03.c +1
-1- .tcnt = 9, + .tcnt = ARRAY_SIZE(ldiscs) - 1,
---
Note:
Our agent completed the review of the patch. The full review can be found at: https://patchwork.ozlabs.org/project/ltp/list/?series=501361
The agent can sometimes produce false positives although often its findings are genuine. If you find issues with the review, please comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Patch merged, thanks!
Signature · 5 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp