diff options
Diffstat (limited to 'plugins/tests/test_utils.c')
-rw-r--r-- | plugins/tests/test_utils.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/plugins/tests/test_utils.c b/plugins/tests/test_utils.c index 27e28c75..5aa0028a 100644 --- a/plugins/tests/test_utils.c +++ b/plugins/tests/test_utils.c | |||
@@ -34,7 +34,7 @@ main (int argc, char **argv) | |||
34 | thresholds *thresholds = NULL; | 34 | thresholds *thresholds = NULL; |
35 | int rc; | 35 | int rc; |
36 | 36 | ||
37 | plan_tests(66); | 37 | plan_tests(73); |
38 | 38 | ||
39 | range = parse_range_string("6"); | 39 | range = parse_range_string("6"); |
40 | ok( range != NULL, "'6' is valid range"); | 40 | ok( range != NULL, "'6' is valid range"); |
@@ -136,6 +136,35 @@ main (int argc, char **argv) | |||
136 | ok( get_status(30.0001, thresholds) == STATE_WARNING, "30.0001 - warning"); | 136 | ok( get_status(30.0001, thresholds) == STATE_WARNING, "30.0001 - warning"); |
137 | ok( get_status(69, thresholds) == STATE_CRITICAL, "69 - critical"); | 137 | ok( get_status(69, thresholds) == STATE_CRITICAL, "69 - critical"); |
138 | 138 | ||
139 | char *test; | ||
140 | test = np_escaped_string("bob\\n"); | ||
141 | ok( strcmp(test, "bob\n") == 0, "bob\\n ok"); | ||
142 | free(test); | ||
143 | |||
144 | test = np_escaped_string("rhuba\\rb"); | ||
145 | ok( strcmp(test, "rhuba\rb") == 0, "rhuba\\rb okay"); | ||
146 | free(test); | ||
147 | |||
148 | test = np_escaped_string("ba\\nge\\r"); | ||
149 | ok( strcmp(test, "ba\nge\r") == 0, "ba\\nge\\r okay"); | ||
150 | free(test); | ||
151 | |||
152 | test = np_escaped_string("\\rabbi\\t"); | ||
153 | ok( strcmp(test, "\rabbi\t") == 0, "\\rabbi\\t okay"); | ||
154 | free(test); | ||
155 | |||
156 | test = np_escaped_string("and\\\\or"); | ||
157 | ok( strcmp(test, "and\\or") == 0, "and\\\\or okay"); | ||
158 | free(test); | ||
159 | |||
160 | test = np_escaped_string("bo\\gus"); | ||
161 | ok( strcmp(test, "bogus") == 0, "bo\\gus okay"); | ||
162 | free(test); | ||
163 | |||
164 | test = np_escaped_string("everything"); | ||
165 | ok( strcmp(test, "everything") == 0, "everything okay"); | ||
166 | free(test); | ||
167 | |||
139 | return exit_status(); | 168 | return exit_status(); |
140 | } | 169 | } |
141 | 170 | ||