]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: test-ostream-multiplex - Clarify the assert/comment
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 8 Jan 2024 15:13:16 +0000 (10:13 -0500)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 2 Feb 2024 09:18:48 +0000 (11:18 +0200)
src/lib/test-ostream-multiplex.c

index d5b7ac1173b1b9031183aa43fec3170a3e233ed1..8bf0e9411b8f59d8b9a6f69112491d81ca450354 100644 (file)
@@ -246,11 +246,10 @@ static void test_ostream_multiplex_hang(void)
        test_assert(o_stream_finish(channel2) == 0);
        o_stream_uncork(channel);
        o_stream_uncork(channel2);
-       /* We expect the first channel to have data buffered */
-       test_assert(o_stream_get_buffer_used_size(channel) >=
+       /* The previous writes must leave some data buffered into channel 0.
+          Otherwise the test isn't fully testing what it's supposed to be. */
+       test_assert(o_stream_get_buffer_used_size(channel) >
                    o_stream_get_buffer_used_size(file_output));
-       test_assert(o_stream_get_buffer_used_size(channel) -
-                   o_stream_get_buffer_used_size(file_output) > 0);
 
        /* read everything that was already sent */
        struct istream *file_input = i_stream_create_fd(fd[0], 1024);