[test suite] trigger a couple of -p errors for code coverage
This commit is contained in:
+1
-3
@@ -1142,11 +1142,9 @@ count_characters(const char *str, const char match, int len)
|
||||
{
|
||||
int i, count = 0;
|
||||
|
||||
for (i=0; i < len; i++) {
|
||||
for (i=0; i < len && str[i] != '\0'; i++) {
|
||||
if (str[i] == match)
|
||||
count++;
|
||||
if (str[i] == '\0')
|
||||
return count;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -192,6 +192,27 @@
|
||||
'exec_err' => $YES,
|
||||
'cmdline' => "$fwknopCmd -A tcp/600001 -a $fake_ip -D $loopback_ip",
|
||||
},
|
||||
|
||||
### trigger strtol() error
|
||||
{
|
||||
'category' => 'basic operations',
|
||||
'subcategory' => 'client',
|
||||
'detail' => 'invalid SPA destination port (1)',
|
||||
'function' => \&generic_exec,
|
||||
'exec_err' => $YES,
|
||||
'cmdline' => "$fwknopCmd -A tcp/22 -a $fake_ip -D $loopback_ip -p 9999999999999999999999999999999999999999999999999999999999",
|
||||
},
|
||||
|
||||
### trigger MAX_PORT error
|
||||
{
|
||||
'category' => 'basic operations',
|
||||
'subcategory' => 'client',
|
||||
'detail' => 'invalid SPA destination port (2)',
|
||||
'function' => \&generic_exec,
|
||||
'exec_err' => $YES,
|
||||
'cmdline' => "$fwknopCmd -A tcp/22 -a $fake_ip -D $loopback_ip -p 99999",
|
||||
},
|
||||
|
||||
{
|
||||
'category' => 'basic operations',
|
||||
'subcategory' => 'client',
|
||||
|
||||
Reference in New Issue
Block a user