diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-09-15 12:59:37 +0200 |
|---|---|---|
| committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-09-15 12:59:37 +0200 |
| commit | 802e46f8ea36c344f112d7e1dd8d64d17a4cc939 (patch) | |
| tree | cabf480269113686430053d66df3dadcd4d137a7 /lib/tests/test_tcp.c | |
| parent | a3cf9041af810770daf5d9b83f1906fa9bb0dd11 (diff) | |
| download | monitoring-plugins-802e46f8ea36c344f112d7e1dd8d64d17a4cc939.tar.gz | |
Run clang-format again
Diffstat (limited to 'lib/tests/test_tcp.c')
| -rw-r--r-- | lib/tests/test_tcp.c | 23 |
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 | ||
