Skip to contentSkip to conversation

lib: Allow zero iterations (-i0)

PATCH In review Petr Vorel 3 participants 4 messages Feb 6, 2023 Library code

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 lib: Allow zero iterations (-i0)

-i0 is helpful to test if setup and cleanup are working. We suggest that in maintainer-patch-review-checklist.txt.

Fixes 4c0465f217 ("lib: Replace atoi/atof with SAFE_STRTOL/SAFE_STRTOF")
---
 lib/tst_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/tst_test.c +1 -1
index 23d21c8255..04d6b13bfc 100644
@@ -678,7 +678,7 @@ static void parse_opts(int argc, char *argv[])
 			print_test_tags();
 			exit(0);
 		case 'i':
-			iterations = SAFE_STRTOL(optarg, 1, INT_MAX);
+			iterations = SAFE_STRTOL(optarg, 0, INT_MAX);
 		break;
 		case 'I':
 			if (tst_test->max_runtime > 0)
Signature · 5 lines
2.39.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 16 lines · IST Petr Vorel

-i0 is helpful to test if setup and cleanup are working. We suggest that in maintainer-patch-review-checklist.txt.

Fixes 4c0465f217 ("lib: Replace atoi/atof with SAFE_STRTOL/SAFE_STRTOF")
---
 lib/tst_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/tst_test.c +0 -0
index 23d21c8255..04d6b13bfc 100644

lib/tst_test.c static void parse_opts(int argc, char *argv[]) · line 684

Quoted 8 lines
lib/tst_test.c +1 -1
@@ -678,7 +678,7 @@ static void parse_opts(int argc, char *argv[])
 			print_test_tags();
 			exit(0);
 		case 'i':
-			iterations = SAFE_STRTOL(optarg, 1, INT_MAX);
+			iterations = SAFE_STRTOL(optarg, 0, INT_MAX);
 		break;
 		case 'I':
 			if (tst_test->max_runtime > 0)

Regards,
Avinesh

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Acked-by on v1 1/1
#2 lore raw
In reply to Petr Vorel
Quoted 3 lines · Petr Vorel

-i0 is helpful to test if setup and cleanup are working. We suggest that in maintainer-patch-review-checklist.txt.

Until now, I never thought of trying -i0 :-)

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#3 lore raw

Hi all,

thanks a lot, merged!

Quoted 6 lines · Petr Vorel
Quoted 3 lines

-i0 is helpful to test if setup and cleanup are working. We suggest that in maintainer-patch-review-checklist.txt.

Until now, I never thought of trying -i0 :-)

Credit goes to Martin Doucha, who let me know some time ago.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp