summaryrefslogtreecommitdiffstats
path: root/lib/tests/test_tcp.c
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2024-10-31 00:30:50 (GMT)
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2024-10-31 00:30:50 (GMT)
commit880e57271d66b34240b58bdbeaf9d53a08958eb2 (patch)
tree73bbcd7f37ecadb6a117a9cd654df39e60e22180 /lib/tests/test_tcp.c
parente480c2bf48e1e905310f10ffbf1ddb190bf2e107 (diff)
downloadmonitoring-plugins-880e57271d66b34240b58bdbeaf9d53a08958eb2.tar.gz
lib: clang-format
Diffstat (limited to 'lib/tests/test_tcp.c')
-rw-r--r--lib/tests/test_tcp.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/tests/test_tcp.c b/lib/tests/test_tcp.c
index b09c005..1b3003e 100644
--- a/lib/tests/test_tcp.c
+++ b/lib/tests/test_tcp.c
@@ -32,15 +32,21 @@ 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, "Test matching any string at the beginning (first expect string)"); 35 ok(np_expect_match("AA bb CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_SUCCESS,
36 ok(np_expect_match("bb AA CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_SUCCESS, "Test matching any string at the beginning (second expect string)"); 36 "Test matching any string at the beginning (first expect string)");
37 ok(np_expect_match("b", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_RETRY, "Test matching any string at the beginning (substring match)"); 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("XX bb AA CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_FAILURE, "Test with strings not matching at the beginning"); 38 "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,
40 "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,
42 "Test with strings not matching at the beginning");
39 ok(np_expect_match("XX CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_FAILURE, "Test matching any string"); 43 ok(np_expect_match("XX CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_FAILURE, "Test matching any string");
40 ok(np_expect_match("XX", server_expect, server_expect_count, 0) == NP_MATCH_RETRY, "Test not matching any string"); 44 ok(np_expect_match("XX", server_expect, server_expect_count, 0) == NP_MATCH_RETRY, "Test not matching any string");
41 ok(np_expect_match("XX AA bb CC XX", server_expect, server_expect_count, NP_MATCH_ALL) == NP_MATCH_SUCCESS, "Test matching all strings"); 45 ok(np_expect_match("XX AA bb CC XX", server_expect, server_expect_count, NP_MATCH_ALL) == NP_MATCH_SUCCESS,
46 "Test matching all strings");
42 ok(np_expect_match("XX bb CC XX", server_expect, server_expect_count, NP_MATCH_ALL) == NP_MATCH_RETRY, "Test not 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");
43 ok(np_expect_match("XX XX", server_expect, server_expect_count, NP_MATCH_ALL) == NP_MATCH_RETRY, "Test not matching any string (testing all)"); 48 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)");
44 50
45 return exit_status(); 51 return exit_status();
46} 52}