diff options
author | Ton Voon <ton.voon@opsera.com> | 2010-06-22 11:47:54 +0100 |
---|---|---|
committer | Ton Voon <ton.voon@opsera.com> | 2010-06-22 11:47:54 +0100 |
commit | 9ff89b1a99926ebfeaeba7f415ae74f93eaef0a5 (patch) | |
tree | 19387dc5aa14bf563f7e599b355cc1fb33c947f2 /lib/tests | |
parent | 10364a6004616c2e52852d80b1e1817056aa7119 (diff) | |
download | monitoring-plugins-9ff89b1a99926ebfeaeba7f415ae74f93eaef0a5.tar.gz |
Added np_set_args, to set arguments after np_extra_opts has been run
Diffstat (limited to 'lib/tests')
-rw-r--r-- | lib/tests/test_utils.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/tests/test_utils.c b/lib/tests/test_utils.c index 4f761a6d..deb592d6 100644 --- a/lib/tests/test_utils.c +++ b/lib/tests/test_utils.c | |||
@@ -40,7 +40,7 @@ main (int argc, char **argv) | |||
40 | char *temp_filename; | 40 | char *temp_filename; |
41 | FILE *temp_fp; | 41 | FILE *temp_fp; |
42 | 42 | ||
43 | plan_tests(137); | 43 | plan_tests(141); |
44 | 44 | ||
45 | ok( this_nagios_plugin==NULL, "nagios_plugin not initialised"); | 45 | ok( this_nagios_plugin==NULL, "nagios_plugin not initialised"); |
46 | 46 | ||
@@ -49,6 +49,15 @@ main (int argc, char **argv) | |||
49 | ok( this_nagios_plugin!=NULL, "nagios_plugin now initialised"); | 49 | ok( this_nagios_plugin!=NULL, "nagios_plugin now initialised"); |
50 | ok( !strcmp(this_nagios_plugin->plugin_name, "check_test"), "plugin name initialised" ); | 50 | ok( !strcmp(this_nagios_plugin->plugin_name, "check_test"), "plugin name initialised" ); |
51 | 51 | ||
52 | ok( this_nagios_plugin->argc==argc, "Argc set" ); | ||
53 | ok( this_nagios_plugin->argv==argv, "Argv set" ); | ||
54 | |||
55 | np_set_args(0,0); | ||
56 | |||
57 | ok( this_nagios_plugin->argc==0, "argc changed" ); | ||
58 | ok( this_nagios_plugin->argv==0, "argv changed" ); | ||
59 | |||
60 | np_set_args(argc, argv); | ||
52 | 61 | ||
53 | range = parse_range_string("6"); | 62 | range = parse_range_string("6"); |
54 | ok( range != NULL, "'6' is valid range"); | 63 | ok( range != NULL, "'6' is valid range"); |