summaryrefslogtreecommitdiffstats
path: root/lib/tests
diff options
context:
space:
mode:
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)
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");