]> 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)
committerMarkus Valentin <markus.valentin@open-xchange.com>
Tue, 17 Jan 2023 11:10:41 +0000 (12:10 +0100)
src/lib-http/test-http-payload.c

index 4e638618a41b4396a27510213fdc962b8fa3be11..690f465d34a57b7c969e5d9c5b05290f31f670a5 100644 (file)
@@ -199,7 +199,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;
 }
 
 /*
@@ -1036,7 +1038,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);
                        }
@@ -1289,7 +1292,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);
                        }