From c6547a118edebc1bbf097a9bc77ccb5eb5783e9c Mon Sep 17 00:00:00 2001 From: David Schweikert Date: Tue, 1 Nov 2016 12:01:18 +0100 Subject: [PATCH] fix tests --- ci/test-03-forbidden.pl | 12 ++++++------ src/fping.c | 4 +--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/ci/test-03-forbidden.pl b/ci/test-03-forbidden.pl index 2ea8f79..9b1c960 100755 --- a/ci/test-03-forbidden.pl +++ b/ci/test-03-forbidden.pl @@ -2,13 +2,13 @@ use Test::Command tests => 33; -# fping -i 9 -my $cmd1 = Test::Command->new(cmd => "fping -i 9 -T10 -g 127.0.0.1/29"); +# fping -i 0 +my $cmd1 = Test::Command->new(cmd => "fping -i 0 -T10 -g 127.0.0.1/29"); $cmd1->exit_is_num(1); $cmd1->stdout_is_eq(""); $cmd1->stderr_is_eq(<= 10, p >= 20, r < 20, and t >= 50 +fping: You need i >= 1, p >= 20, r < 20, and t >= 50 END # fping -p 15 @@ -17,7 +17,7 @@ $cmd2->exit_is_num(1); $cmd2->stdout_is_eq(""); $cmd2->stderr_is_eq(<= 10, p >= 20, r < 20, and t >= 50 +fping: You need i >= 1, p >= 20, r < 20, and t >= 50 END # fping -r 30 @@ -26,7 +26,7 @@ $cmd3->exit_is_num(1); $cmd3->stdout_is_eq(""); $cmd3->stderr_is_eq(<= 10, p >= 20, r < 20, and t >= 50 +fping: You need i >= 1, p >= 20, r < 20, and t >= 50 END # fping -t 40 @@ -35,7 +35,7 @@ $cmd4->exit_is_num(1); $cmd4->stdout_is_eq(""); $cmd4->stderr_is_eq(<= 10, p >= 20, r < 20, and t >= 50 +fping: You need i >= 1, p >= 20, r < 20, and t >= 50 END # fping -H 300 diff --git a/src/fping.c b/src/fping.c index 1002518..9c5e682 100644 --- a/src/fping.c +++ b/src/fping.c @@ -404,9 +404,7 @@ int main( int argc, char **argv ) break; case 'i': - if( !( interval = ( unsigned int )atoi( optarg ) * 100 ) ) - usage(1); - + interval = ( unsigned int )atoi( optarg ) * 100; break; case 'p':