]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-program-client: test-program-client-unix: Properly recognize the noreply script...
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 25 Feb 2018 17:38:23 +0000 (18:38 +0100)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Sun, 18 Mar 2018 10:53:18 +0000 (12:53 +0200)
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

index 60841270ad12eefe9f97d96c20a9a9326659a0d9..d62028b8600976cc7cb4873a99009ddeb2154b8a 100644 (file)
@@ -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