diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-12 17:42:10 +0200 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-12 17:42:10 +0200 |
commit | 662997251d4fc43f4155784f9e7df827f193305e (patch) | |
tree | 0a9ad5c5607598da0eb6b6d71fa8c47ca44186fb /lib/tests | |
parent | ca9ce71576ddf78cc54fe3b6f0428cdfea72e9df (diff) | |
download | monitoring-plugins-662997251d4fc43f4155784f9e7df827f193305e.tar.gz |
Improve interface of np_expect_match() function
Replace the three boolean parameters of lib/utils_tcp.c's
np_expect_match() function with a single "flags" parameter.
Diffstat (limited to 'lib/tests')
-rw-r--r-- | lib/tests/test_tcp.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/tests/test_tcp.c b/lib/tests/test_tcp.c index 6cf93946..8e9d43c8 100644 --- a/lib/tests/test_tcp.c +++ b/lib/tests/test_tcp.c | |||
@@ -33,21 +33,21 @@ main (int argc, char **argv) | |||
33 | server_expect[1] = strdup("bb"); | 33 | server_expect[1] = strdup("bb"); |
34 | server_expect[2] = strdup("CC"); | 34 | server_expect[2] = strdup("CC"); |
35 | 35 | ||
36 | ok(np_expect_match("AA bb CC XX", server_expect, server_expect_count, FALSE, TRUE, FALSE) == TRUE, | 36 | ok(np_expect_match("AA bb CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == TRUE, |
37 | "Test matching any string at the beginning (first expect string)"); | 37 | "Test matching any string at the beginning (first expect string)"); |
38 | ok(np_expect_match("bb AA CC XX", server_expect, server_expect_count, FALSE, TRUE, FALSE) == TRUE, | 38 | ok(np_expect_match("bb AA CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == TRUE, |
39 | "Test matching any string at the beginning (second expect string)"); | 39 | "Test matching any string at the beginning (second expect string)"); |
40 | ok(np_expect_match("XX bb AA CC XX", server_expect, server_expect_count, FALSE, TRUE, FALSE) == FALSE, | 40 | ok(np_expect_match("XX bb AA CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == FALSE, |
41 | "Test with strings not matching at the beginning"); | 41 | "Test with strings not matching at the beginning"); |
42 | ok(np_expect_match("XX CC XX", server_expect, server_expect_count, FALSE, TRUE, FALSE) == FALSE, | 42 | ok(np_expect_match("XX CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == FALSE, |
43 | "Test matching any string"); | 43 | "Test matching any string"); |
44 | ok(np_expect_match("XX", server_expect, server_expect_count, FALSE, FALSE, FALSE) == FALSE, | 44 | ok(np_expect_match("XX", server_expect, server_expect_count, 0) == FALSE, |
45 | "Test not matching any string"); | 45 | "Test not matching any string"); |
46 | ok(np_expect_match("XX AA bb CC XX", server_expect, server_expect_count, TRUE, FALSE, FALSE) == TRUE, | 46 | ok(np_expect_match("XX AA bb CC XX", server_expect, server_expect_count, NP_MATCH_ALL) == TRUE, |
47 | "Test matching all strings"); | 47 | "Test matching all strings"); |
48 | ok(np_expect_match("XX bb CC XX", server_expect, server_expect_count, TRUE, FALSE, FALSE) == FALSE, | 48 | ok(np_expect_match("XX bb CC XX", server_expect, server_expect_count, NP_MATCH_ALL) == FALSE, |
49 | "Test not matching all strings"); | 49 | "Test not matching all strings"); |
50 | ok(np_expect_match("XX XX", server_expect, server_expect_count, TRUE, FALSE, FALSE) == FALSE, | 50 | ok(np_expect_match("XX XX", server_expect, server_expect_count, NP_MATCH_ALL) == FALSE, |
51 | "Test not matching any string (testing all)"); | 51 | "Test not matching any string (testing all)"); |
52 | 52 | ||
53 | 53 | ||