From 81f430edc671b1a38c3389b6d84fe2f2c9e48e30 Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Sun, 25 Feb 2018 18:38:23 +0100 Subject: [PATCH] lib-program-client: test-program-client-unix: Properly recognize the noreply script protocol option. Somehow the equivalent test-program-client-net code does not have this problem. And somehow this test did not fail before. --- src/lib-program-client/test-program-client-unix.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib-program-client/test-program-client-unix.c b/src/lib-program-client/test-program-client-unix.c index 60841270ad..d62028b860 100644 --- a/src/lib-program-client/test-program-client-unix.c +++ b/src/lib-program-client/test-program-client-unix.c @@ -78,7 +78,7 @@ static void test_program_client_destroy(struct test_client **_client) static int test_program_input_handle(struct test_client *client, const char *line) { - int cmp; + int cmp = -1; const char *arg; switch(client->state) { @@ -90,7 +90,10 @@ test_program_input_handle(struct test_client *client, const char *line) return -1; break; case CLIENT_STATE_VERSION: - test_assert((cmp = strcmp(line, "-")) == 0); + if (strcmp(line, "noreply") == 0 || + strcmp(line, "-") == 0) + cmp = 0; + test_assert(cmp == 0); if (cmp == 0) client->state = CLIENT_STATE_ARGS; else -- 2.47.3