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

Ton Voon tonvoon at users.sourceforge.net
Fri Jul 14 01:58:02 CEST 2006


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

Modified Files:
	test_utils.c 
Log Message:
Major fixes to check_disk. Now should return same data as df


Index: test_utils.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/lib/tests/test_utils.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- test_utils.c	13 Jul 2006 12:50:21 -0000	1.1
+++ test_utils.c	13 Jul 2006 23:58:00 -0000	1.2
@@ -31,7 +31,7 @@
 	thresholds *thresholds = NULL;
 	int	rc;
 
-	plan_tests(74);
+	plan_tests(82);
 
 	range = parse_range_string("6");
 	ok( range != NULL, "'6' is valid range");
@@ -41,6 +41,14 @@
 	ok( range->end_infinity == FALSE, "Not using infinity");
 	free(range);
 
+	range = parse_range_string("1:12%%");
+	ok( range != NULL, "'1:12%%' is valid - percentages are ignored");
+	ok( range->start == 1, "Start correct");
+	ok( range->start_infinity == FALSE, "Not using negative infinity");
+	ok( range->end == 12, "End correct");
+	ok( range->end_infinity == FALSE, "Not using infinity");
+	free(range);
+
 	range = parse_range_string("-7:23");
 	ok( range != NULL, "'-7:23' is valid range");
 	ok( range->start == -7, "Start correct");
@@ -114,6 +122,11 @@
 	range = parse_range_string("2:1");
 	ok( range == NULL, "'2:1' rejected");
 
+	rc = _set_thresholds(&thresholds, NULL, NULL);
+	ok( rc == 0, "Thresholds (NULL, NULL) set");
+	ok( thresholds->warning == NULL, "Warning not set");
+	ok( thresholds->critical == NULL, "Critical not set");
+
 	rc = _set_thresholds(&thresholds, NULL, "80");
 	ok( rc == 0, "Thresholds (NULL, '80') set");
 	ok( thresholds->warning == NULL, "Warning not set");





More information about the Commits mailing list