]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-imap-client: test-imapc-client - Move server functions.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Mon, 13 Apr 2020 16:49:12 +0000 (18:49 +0200)
committerStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 26 May 2020 09:30:03 +0000 (11:30 +0200)
src/lib-imap-client/test-imapc-client.c

index 57aacdd79860c748c9d975c519c702951ebdcfd0..3ccc919887fbfc3348df5cd96acd3bfa288c968f 100644 (file)
@@ -55,6 +55,30 @@ static struct imapc_client_settings test_imapc_default_settings = {
        .max_idle_time = 10000,
 };
 
+static bool
+test_imapc_server_expect_full(struct test_server *server,
+                             const char *expected_line)
+{
+       const char *line = i_stream_read_next_line(server->input);
+
+       if (line == NULL) {
+               printf("imapc client disconnected unexpectedly: %s\n",
+                      i_stream_get_error(server->input));
+               return FALSE;
+       } else if (strcmp(line, expected_line) != 0) {
+               printf("imapc client sent '%s' when expecting '%s'\n",
+                      line, expected_line);
+               return FALSE;
+       } else {
+               return TRUE;
+       }
+}
+
+static bool test_imapc_server_expect(const char *expected_line)
+{
+       return test_imapc_server_expect_full(&server, expected_line);
+}
+
 static void
 test_server_wait_connection(struct test_server *server, bool send_banner)
 {
@@ -192,30 +216,6 @@ static bool test_imapc_cmd_last_reply_expect(enum imapc_command_state state)
        return test_imapc_cmd_last_reply_pop() == state;
 }
 
-static bool
-test_imapc_server_expect_full(struct test_server *server,
-                             const char *expected_line)
-{
-       const char *line = i_stream_read_next_line(server->input);
-
-       if (line == NULL) {
-               printf("imapc client disconnected unexpectedly: %s\n",
-                      i_stream_get_error(server->input));
-               return FALSE;
-       } else if (strcmp(line, expected_line) != 0) {
-               printf("imapc client sent '%s' when expecting '%s'\n",
-                      line, expected_line);
-               return FALSE;
-       } else {
-               return TRUE;
-       }
-}
-
-static bool test_imapc_server_expect(const char *expected_line)
-{
-       return test_imapc_server_expect_full(&server, expected_line);
-}
-
 static void imapc_login_callback(const struct imapc_command_reply *reply,
                                 void *context ATTR_UNUSED)
 {