summaryrefslogtreecommitdiffstats
path: root/lib/tests/test_tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tests/test_tcp.c')
-rw-r--r--lib/tests/test_tcp.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/lib/tests/test_tcp.c b/lib/tests/test_tcp.c
index 1b3003e9..de3a2102 100644
--- a/lib/tests/test_tcp.c
+++ b/lib/tests/test_tcp.c
@@ -32,19 +32,28 @@ int main(void) {
32 server_expect[1] = strdup("bb"); 32 server_expect[1] = strdup("bb");
33 server_expect[2] = strdup("CC"); 33 server_expect[2] = strdup("CC");
34 34
35 ok(np_expect_match("AA bb CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_SUCCESS, 35 ok(np_expect_match("AA bb CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) ==
36 NP_MATCH_SUCCESS,
36 "Test matching any string at the beginning (first expect string)"); 37 "Test matching any string at the beginning (first expect string)");
37 ok(np_expect_match("bb AA CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_SUCCESS, 38 ok(np_expect_match("bb AA CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) ==
39 NP_MATCH_SUCCESS,
38 "Test matching any string at the beginning (second expect string)"); 40 "Test matching any string at the beginning (second expect string)");
39 ok(np_expect_match("b", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_RETRY, 41 ok(np_expect_match("b", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_RETRY,
40 "Test matching any string at the beginning (substring match)"); 42 "Test matching any string at the beginning (substring match)");
41 ok(np_expect_match("XX bb AA CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_FAILURE, 43 ok(np_expect_match("XX bb AA CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) ==
44 NP_MATCH_FAILURE,
42 "Test with strings not matching at the beginning"); 45 "Test with strings not matching at the beginning");
43 ok(np_expect_match("XX CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_FAILURE, "Test matching any string"); 46 ok(np_expect_match("XX CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) ==
44 ok(np_expect_match("XX", server_expect, server_expect_count, 0) == NP_MATCH_RETRY, "Test not matching any string"); 47 NP_MATCH_FAILURE,
45 ok(np_expect_match("XX AA bb CC XX", server_expect, server_expect_count, NP_MATCH_ALL) == NP_MATCH_SUCCESS, 48 "Test matching any string");
49 ok(np_expect_match("XX", server_expect, server_expect_count, 0) == NP_MATCH_RETRY,
50 "Test not matching any string");
51 ok(np_expect_match("XX AA bb CC XX", server_expect, server_expect_count, NP_MATCH_ALL) ==
52 NP_MATCH_SUCCESS,
46 "Test matching all strings"); 53 "Test matching all strings");
47 ok(np_expect_match("XX bb CC XX", server_expect, server_expect_count, NP_MATCH_ALL) == NP_MATCH_RETRY, "Test not matching all strings"); 54 ok(np_expect_match("XX bb CC XX", server_expect, server_expect_count, NP_MATCH_ALL) ==
55 NP_MATCH_RETRY,
56 "Test not matching all strings");
48 ok(np_expect_match("XX XX", server_expect, server_expect_count, NP_MATCH_ALL) == NP_MATCH_RETRY, 57 ok(np_expect_match("XX XX", server_expect, server_expect_count, NP_MATCH_ALL) == NP_MATCH_RETRY,
49 "Test not matching any string (testing all)"); 58 "Test not matching any string (testing all)");
50 59