]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: test-ostream-* - Call o_stream_nfinish() after uncorking
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 27 Oct 2017 21:13:28 +0000 (00:13 +0300)
committerTimo Sirainen <tss@dovecot.fi>
Mon, 30 Oct 2017 11:04:53 +0000 (13:04 +0200)
src/lib/test-ostream-buffer.c
src/lib/test-ostream-file.c

index 40d5aeb28bea023b3a3cae5b19413e9b7852b966..af5253cdd252e661fbff9a6c1908d48471ffd7bb 100644 (file)
@@ -38,8 +38,8 @@ static void test_ostream_buffer_random_once(void)
                        test_assert(o_stream_flush(output) > 0);
        }
 
-       test_assert(o_stream_flush(output) > 0);
        o_stream_uncork(output);
+       test_assert(o_stream_nfinish(output) == 0);
 
        i_assert(buffer->used <= MAX_BUFSIZE*4);
        test_assert(memcmp(buf, buffer->data, buffer->used) == 0);
index ef492483502c89c76cdde59ad11c2534361d433b..4383ba4f2a8d11670fc4dd5bd3d7df37dfe606fe 100644 (file)
@@ -45,8 +45,8 @@ static void test_ostream_file_random_once(void)
                        test_assert(o_stream_flush(output) > 0);
        }
 
-       test_assert(o_stream_flush(output) > 0);
        o_stream_uncork(output);
+       test_assert(o_stream_nfinish(output) == 0);
        ret = pread(fd, buf2, sizeof(buf2), 0);
        if (ret < 0)
                i_fatal("pread() failed: %m");