diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tests/plugins.ini | 10 | ||||
-rw-r--r-- | lib/tests/test_opts.c | 21 |
2 files changed, 31 insertions, 0 deletions
diff --git a/lib/tests/plugins.ini b/lib/tests/plugins.ini index 5e20deda..6c2039f3 100644 --- a/lib/tests/plugins.ini +++ b/lib/tests/plugins.ini | |||
@@ -5,3 +5,13 @@ foo=bar | |||
5 | [section1] | 5 | [section1] |
6 | foobar=baz | 6 | foobar=baz |
7 | 7 | ||
8 | ; defaults for check_tcp | ||
9 | [check_tcp] | ||
10 | timeout = 10 | ||
11 | |||
12 | [tcp_long_lines] | ||
13 | escape = | ||
14 | send = Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda | ||
15 | expect = Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda | ||
16 | jail= | ||
17 | |||
diff --git a/lib/tests/test_opts.c b/lib/tests/test_opts.c index e6623d1b..f7599ff8 100644 --- a/lib/tests/test_opts.c +++ b/lib/tests/test_opts.c | |||
@@ -273,6 +273,27 @@ main (int argc, char **argv) | |||
273 | ok(array_diff(argc_test, argv_test, 5, argv_known), "Default section 4"); | 273 | ok(array_diff(argc_test, argv_test, 5, argv_known), "Default section 4"); |
274 | my_free(&argc_test,argv_test); | 274 | my_free(&argc_test,argv_test); |
275 | 275 | ||
276 | argv_test=(char **)malloc(4*sizeof(char **)); | ||
277 | argv_test[0] = "check_tcp"; | ||
278 | argv_test[1] = "--extra-opts"; | ||
279 | argv_test[2] = "--extra-opts=tcp_long_lines@plugins.ini"; | ||
280 | argv_test[3] = NULL; | ||
281 | argc_test=3; | ||
282 | argv_known=(char **)realloc(argv_known, 10*sizeof(char **)); | ||
283 | argv_known[0] = "check_tcp"; | ||
284 | argv_known[1] = "--timeout"; | ||
285 | argv_known[2] = "10"; | ||
286 | argv_known[3] = "--escape"; | ||
287 | argv_known[4] = "--send"; | ||
288 | argv_known[5] = "Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda"; | ||
289 | argv_known[6] = "--expect"; | ||
290 | argv_known[7] = "Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda"; | ||
291 | argv_known[8] = "--jail"; | ||
292 | argv_known[9] = NULL; | ||
293 | argv_test=np_extra_opts(&argc_test, argv_test, "check_tcp"); | ||
294 | ok(array_diff(argc_test, argv_test, 9, argv_known), "Long lines test"); | ||
295 | my_free(&argc_test,argv_test); | ||
296 | |||
276 | return exit_status(); | 297 | return exit_status(); |
277 | } | 298 | } |
278 | 299 | ||