[Nagiosplug-checkins] nagiosplug/lib/tests test_disk.c,1.1,1.2

Ton Voon tonvoon at users.sourceforge.net
Wed Oct 18 14:05:12 CEST 2006


Update of /cvsroot/nagiosplug/nagiosplug/lib/tests
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5638/lib/tests

Modified Files:
	test_disk.c 
Log Message:
Fix tests for exact matches when searching filesystems


Index: test_disk.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/lib/tests/test_disk.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- test_disk.c	13 Jul 2006 12:50:21 -0000	1.1
+++ test_disk.c	18 Oct 2006 12:05:10 -0000	1.2
@@ -36,7 +36,7 @@
 	struct mount_entry *me;
 	struct mount_entry **mtail = &dummy_mount_list;
 
-	plan_tests(17);
+	plan_tests(18);
 
 	ok( np_find_name(exclude_filesystem, "/var/log") == FALSE, "/var/log not in list");
 	np_add_name(&exclude_filesystem, "/var/log");
@@ -105,17 +105,20 @@
 	np_add_parameter(&paths, "/var");
 	np_add_parameter(&paths, "/tmp");
 	np_add_parameter(&paths, "/home/tonvoon");
+	np_add_parameter(&paths, "/home");
 
 	np_set_best_match(paths, dummy_mount_list, TRUE);
 	for (p = paths; p; p = p->name_next) {
 		if (! strcmp(p->name, "/home/groups")) {
-			ok( p->found == 0, "/home/groups correctly not found");
+			ok( ! p->best_match , "/home/groups correctly not found");
 		} else if (! strcmp(p->name, "/var")) {
-			ok( p->found == 1, "/var found");
+			ok( p->best_match, "/var found");
 		} else if (! strcmp(p->name, "/tmp")) {
-			ok( p->found == 0, "/tmp correctly not found");
+			ok(! p->best_match, "/tmp correctly not found");
 		} else if (! strcmp(p->name, "/home/tonvoon")) {
-			ok( p->found == 0, "/home/tonvoon not found");
+			ok(! p->best_match, "/home/tonvoon not found");
+		} else if (! strcmp(p->name, "/home")) {
+			ok( p->best_match, "/home found");
 		}
 	}
 





More information about the Commits mailing list