From 9ff89b1a99926ebfeaeba7f415ae74f93eaef0a5 Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Tue, 22 Jun 2010 11:47:54 +0100 Subject: Added np_set_args, to set arguments after np_extra_opts has been run --- lib/tests/test_utils.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/tests') 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) char *temp_filename; FILE *temp_fp; - plan_tests(137); + plan_tests(141); ok( this_nagios_plugin==NULL, "nagios_plugin not initialised"); @@ -49,6 +49,15 @@ main (int argc, char **argv) ok( this_nagios_plugin!=NULL, "nagios_plugin now initialised"); ok( !strcmp(this_nagios_plugin->plugin_name, "check_test"), "plugin name initialised" ); + ok( this_nagios_plugin->argc==argc, "Argc set" ); + ok( this_nagios_plugin->argv==argv, "Argv set" ); + + np_set_args(0,0); + + ok( this_nagios_plugin->argc==0, "argc changed" ); + ok( this_nagios_plugin->argv==0, "argv changed" ); + + np_set_args(argc, argv); range = parse_range_string("6"); ok( range != NULL, "'6' is valid range"); -- cgit v1.2.3-74-g34f1