summaryrefslogtreecommitdiffstats
path: root/lib/tests/test_utils.c
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2006-07-13 23:58:00 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2006-07-13 23:58:00 (GMT)
commit5912398b9723545ecd061650667cbb238be85743 (patch)
treee5d8353cc8d8c278bfc22bd926f613da63f5e83f /lib/tests/test_utils.c
parent548083b2ea865474915fc8a9ddd361e997585a02 (diff)
downloadmonitoring-plugins-5912398b9723545ecd061650667cbb238be85743.tar.gz
Major fixes to check_disk. Now should return same data as df
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1452 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'lib/tests/test_utils.c')
-rw-r--r--lib/tests/test_utils.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/tests/test_utils.c b/lib/tests/test_utils.c
index aedc2a5..96b5333 100644
--- a/lib/tests/test_utils.c
+++ b/lib/tests/test_utils.c
@@ -31,7 +31,7 @@ main (int argc, char **argv)
31 thresholds *thresholds = NULL; 31 thresholds *thresholds = NULL;
32 int rc; 32 int rc;
33 33
34 plan_tests(74); 34 plan_tests(82);
35 35
36 range = parse_range_string("6"); 36 range = parse_range_string("6");
37 ok( range != NULL, "'6' is valid range"); 37 ok( range != NULL, "'6' is valid range");
@@ -41,6 +41,14 @@ main (int argc, char **argv)
41 ok( range->end_infinity == FALSE, "Not using infinity"); 41 ok( range->end_infinity == FALSE, "Not using infinity");
42 free(range); 42 free(range);
43 43
44 range = parse_range_string("1:12%%");
45 ok( range != NULL, "'1:12%%' is valid - percentages are ignored");
46 ok( range->start == 1, "Start correct");
47 ok( range->start_infinity == FALSE, "Not using negative infinity");
48 ok( range->end == 12, "End correct");
49 ok( range->end_infinity == FALSE, "Not using infinity");
50 free(range);
51
44 range = parse_range_string("-7:23"); 52 range = parse_range_string("-7:23");
45 ok( range != NULL, "'-7:23' is valid range"); 53 ok( range != NULL, "'-7:23' is valid range");
46 ok( range->start == -7, "Start correct"); 54 ok( range->start == -7, "Start correct");
@@ -114,6 +122,11 @@ main (int argc, char **argv)
114 range = parse_range_string("2:1"); 122 range = parse_range_string("2:1");
115 ok( range == NULL, "'2:1' rejected"); 123 ok( range == NULL, "'2:1' rejected");
116 124
125 rc = _set_thresholds(&thresholds, NULL, NULL);
126 ok( rc == 0, "Thresholds (NULL, NULL) set");
127 ok( thresholds->warning == NULL, "Warning not set");
128 ok( thresholds->critical == NULL, "Critical not set");
129
117 rc = _set_thresholds(&thresholds, NULL, "80"); 130 rc = _set_thresholds(&thresholds, NULL, "80");
118 ok( rc == 0, "Thresholds (NULL, '80') set"); 131 ok( rc == 0, "Thresholds (NULL, '80') set");
119 ok( thresholds->warning == NULL, "Warning not set"); 132 ok( thresholds->warning == NULL, "Warning not set");