SF.net SVN: nagiosplug:[2143] nagiosplug/trunk/lib/tests

[email protected]
Newsgroups gmane.network.nagios.plugins.cvs
Message-ID <[email protected]>
Revision: 2143
          http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=2143&view=rev
Author:   dermoth
Date:     2009-01-24 12:44:31 +0000 (Sat, 24 Jan 2009)

Log Message:
-----------
Remove the commented out blocks

The die tests are implemented in the test_*3.t files

From: Thomas Guyot-Sionnest <[email protected]>

Modified Paths:
--------------
    nagiosplug/trunk/lib/tests/test_ini1.c
    nagiosplug/trunk/lib/tests/test_opts1.c

Modified: nagiosplug/trunk/lib/tests/test_ini1.c
===================================================================
--- nagiosplug/trunk/lib/tests/test_ini1.c	2009-01-24 05:42:30 UTC (rev 2142)
+++ nagiosplug/trunk/lib/tests/test_ini1.c	2009-01-24 12:44:31 UTC (rev 2143)
@@ -64,14 +64,6 @@
 	ok( !strcmp(optstr, "--one=two --Foo=Bar --this=Your Mother! --blank"), "Used default section name, without specific");
 	my_free(optstr);
 
-	/*
-	 * This check is expected to die - It's commented so we can eventually put
-	 * it in a separate file for testing the return value
-	 */
-	/* optstr=list2str(np_get_defaults("section_unknown@./config-tiny.ini", "section"));
-	ok( 0, "die if section isn't found");
-	my_free(optstr); */
-
 	optstr=list2str(np_get_defaults("Section Two@./config-tiny.ini", "check_disk"));
 	ok( !strcmp(optstr, "--something else=blah --remove=whitespace"), "config-tiny.ini's Section Two as expected");
 	my_free(optstr);

Modified: nagiosplug/trunk/lib/tests/test_opts1.c
===================================================================
--- nagiosplug/trunk/lib/tests/test_opts1.c	2009-01-24 05:42:30 UTC (rev 2142)
+++ nagiosplug/trunk/lib/tests/test_opts1.c	2009-01-24 12:44:31 UTC (rev 2143)
@@ -143,64 +143,6 @@
 	ok(array_diff(argc_test, argv_test, 7, argv_known), "twice extra opts using two sections");
 	my_free(&argc_test,argv_test);
 
-	/* Next three checks are expected to die. They are commented out as they
-	 * could possibly go in a sepatare test checked for return value.
-	 */
-	/* argv_test=(char **)malloc(6*sizeof(char **));
-	argv_test[0] = "prog_name";
-	argv_test[1] = "arg1";
-	argv_test[2] = "--extra-opts=missing@./config-opts.ini";
-	argv_test[3] = "--arg3";
-	argv_test[4] = "val2";
-	argv_test[5] = NULL;
-	argc_test=5;
-	argv_known=(char **)realloc(argv_known, 5*sizeof(char **));
-	argv_known[0] = "prog_name";
-	argv_known[1] = "arg1";
-	argv_known[2] = "--arg3";
-	argv_known[3] = "val2";
-	argv_known[4] = NULL;
-	argv_test=np_extra_opts(&argc_test, argv_test, "check_missing");
-	ok(array_diff(argc_test, argv_test, 4, argv_known), "Missing section 1");
-	my_free(&argc_test,argv_test); */
-
-	/* argv_test=(char **)malloc(7*sizeof(char **));
-	argv_test[0] = "prog_name";
-	argv_test[1] = "arg1";
-	argv_test[2] = "--extra-opts";
-	argv_test[3] = "missing@./config-opts.ini";
-	argv_test[4] = "--arg3";
-	argv_test[5] = "val2";
-	argv_test[6] = NULL;
-	argc_test=6;
-	argv_known=(char **)realloc(argv_known, 5*sizeof(char **));
-	argv_known[0] = "prog_name";
-	argv_known[1] = "arg1";
-	argv_known[2] = "--arg3";
-	argv_known[3] = "val2";
-	argv_known[4] = NULL;
-	argv_test=np_extra_opts(&argc_test, argv_test, "check_missing");
-	ok(array_diff(argc_test, argv_test, 4, argv_known), "Missing section 2");
-	my_free(&argc_test,argv_test); */
-
-	/* argv_test=(char **)malloc(6*sizeof(char **));
-	argv_test[0] = "prog_name";
-	argv_test[1] = "arg1";
-	argv_test[2] = "--extra-opts";
-	argv_test[3] = "--arg3";
-	argv_test[4] = "val2";
-	argv_test[5] = NULL;
-	argc_test=5;
-	argv_known=(char **)realloc(argv_known, 5*sizeof(char **));
-	argv_known[0] = "prog_name";
-	argv_known[1] = "arg1";
-	argv_known[2] = "--arg3";
-	argv_known[3] = "val2";
-	argv_known[4] = NULL;
-	argv_test=np_extra_opts(&argc_test, argv_test, "check_missing");
-	ok(array_diff(argc_test, argv_test, 4, argv_known), "Missing section 3");
-	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.

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.