[Nagiosplug-checkins] SF.net SVN: nagiosplug:[2066] nagiosplug/trunk/lib/tests
dermoth at users.sourceforge.net
dermoth at users.sourceforge.net
Tue Nov 4 22:52:46 CET 2008
Revision: 2066
http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=2066&view=rev
Author: dermoth
Date: 2008-11-04 21:52:45 +0000 (Tue, 04 Nov 2008)
Log Message:
-----------
Fixed the test (not the bug yet) and added similar one to test_ini (that one works)
Modified Paths:
--------------
nagiosplug/trunk/lib/tests/test_ini.c
nagiosplug/trunk/lib/tests/test_opts.c
Modified: nagiosplug/trunk/lib/tests/test_ini.c
===================================================================
--- nagiosplug/trunk/lib/tests/test_ini.c 2008-11-04 21:31:10 UTC (rev 2065)
+++ nagiosplug/trunk/lib/tests/test_ini.c 2008-11-04 21:52:45 UTC (rev 2066)
@@ -55,7 +55,7 @@
{
char *optstr=NULL;
- plan_tests(11);
+ plan_tests(12);
optstr=list2str(np_get_defaults("section at ./config-tiny.ini", "check_disk"));
ok( !strcmp(optstr, "--one=two --Foo=Bar --this=Your Mother! --blank"), "config-tiny.ini's section as expected");
@@ -109,6 +109,10 @@
ok( !strcmp(optstr, "--foo=bar --bar=foo"), "plugin.ini's section_twice defined twice in the file");
my_free(optstr);
+ optstr=list2str(np_get_defaults("tcp_long_lines at plugins.ini", "check_tcp"));
+ ok( !strcmp(optstr, "--escape --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 --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 --jail"), "Long options");
+ my_free(optstr);
+
return exit_status();
}
Modified: nagiosplug/trunk/lib/tests/test_opts.c
===================================================================
--- nagiosplug/trunk/lib/tests/test_opts.c 2008-11-04 21:31:10 UTC (rev 2065)
+++ nagiosplug/trunk/lib/tests/test_opts.c 2008-11-04 21:52:45 UTC (rev 2066)
@@ -279,19 +279,16 @@
argv_test[2] = "--extra-opts=tcp_long_lines at plugins.ini";
argv_test[3] = NULL;
argc_test=3;
- argv_known=(char **)realloc(argv_known, 10*sizeof(char **));
+ argv_known=(char **)realloc(argv_known, 7*sizeof(char **));
argv_known[0] = "check_tcp";
- argv_known[1] = "--timeout";
- argv_known[2] = "10";
- argv_known[3] = "--escape";
- argv_known[4] = "--send";
- 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";
- argv_known[6] = "--expect";
- 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";
- argv_known[8] = "--jail";
- argv_known[9] = NULL;
+ argv_known[1] = "--timeout=10";
+ argv_known[2] = "--escape";
+ argv_known[3] = "--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";
+ argv_known[4] = "--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";
+ argv_known[5] = "--jail";
+ argv_known[6] = NULL;
argv_test=np_extra_opts(&argc_test, argv_test, "check_tcp");
- ok(array_diff(argc_test, argv_test, 9, argv_known), "Long lines test");
+ ok(array_diff(argc_test, argv_test, 6, argv_known), "Long lines test");
my_free(&argc_test,argv_test);
return exit_status();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list