aboutsummaryrefslogtreecommitdiff
path: root/lib/tests
diff options
context:
space:
mode:
authorGravatar Ton Voon <tonvoon@users.sourceforge.net> 2006-07-13 23:58:00 +0000
committerGravatar Ton Voon <tonvoon@users.sourceforge.net> 2006-07-13 23:58:00 +0000
commit5912398b9723545ecd061650667cbb238be85743 (patch)
treee5d8353cc8d8c278bfc22bd926f613da63f5e83f /lib/tests
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')
-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 aedc2a58..96b5333d 100644
--- a/lib/tests/test_utils.c
+++ b/lib/tests/test_utils.c
@@ -31,7 +31,7 @@ main (int argc, char **argv)
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 @@ main (int argc, char **argv)
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 @@ main (int argc, char **argv)
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");