]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: test-http-payload - Add filenames to data mismatch error messages
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 11 Jan 2023 12:31:55 +0000 (14:31 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Fri, 13 Jan 2023 12:16:26 +0000 (12:16 +0000)
src/lib-http/test-http-payload.c

index 9ca2565d46fa0493014bedcd4e75970e5215a2c3..827de843770ec11fe0d966a63eafa9ad3ef28d04 100644 (file)
@@ -197,7 +197,9 @@ test_file_open(const char *path, unsigned int *status_r, const char **reason_r)
                return NULL;
        }
 
-       return i_stream_create_fd_autoclose(&fd, 40960);
+       struct istream *input = i_stream_create_fd_autoclose(&fd, 40960);
+       i_stream_set_name(input, path);
+       return input;
 }
 
 /*
@@ -1040,7 +1042,8 @@ test_client_download_payload_input(struct test_client_request *tcreq)
                        if (memcmp(pdata, fdata, fsize) != 0) {
                                i_fatal("test client: download: "
                                        "received data does not match file "
-                                       "(%"PRIuUOFF_T":%"PRIuUOFF_T")",
+                                       "(%s, %"PRIuUOFF_T":%"PRIuUOFF_T")",
+                                       i_stream_get_name(tcreq->file_in),
                                        payload->v_offset,
                                        tcreq->file_in->v_offset);
                        }
@@ -1293,7 +1296,8 @@ static void test_client_echo_payload_input(struct test_client_request *tcreq)
                        if (memcmp(pdata, fdata, fsize) != 0) {
                                i_fatal("test client: echo: "
                                        "received data does not match file "
-                                       "(%"PRIuUOFF_T":%"PRIuUOFF_T")",
+                                       "(%s, %"PRIuUOFF_T":%"PRIuUOFF_T")",
+                                       i_stream_get_name(tcreq->file_in),
                                        payload->v_offset,
                                        tcreq->file_in->v_offset);
                        }