]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib, lib-dcrypt: Fix unit tests to check i_stream_read() return value
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sun, 18 Aug 2019 14:44:33 +0000 (17:44 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 10 Sep 2019 07:02:19 +0000 (10:02 +0300)
src/lib-dcrypt/test-stream.c
src/lib/test-iostream-proxy.c

index 153e8b77bcc40dc8de2b4741d4d2d55d218ef3d3..aeed1f75bc07422b137a18ff364dc5c642ab0faf 100644 (file)
@@ -367,7 +367,7 @@ static void test_write_read_v2(void)
        /* test regression where read fails due to incorrect behaviour
           when buffer is full before going to decrypt code */
        i_stream_set_max_buffer_size(is, 8192);
-       i_stream_read(is);
+       test_assert(i_stream_read(is) > 0);
        struct istream *is_2 = i_stream_create_decrypt(is, test_v1_kp.priv);
 
        size_t offset = 0;
index d35008d378aaba954cd77bc809200f239df2972a..9086c5d26f4eed7a3b9dbd04a82305b0e3082ffa 100644 (file)
@@ -73,7 +73,7 @@ void test_iostream_proxy_simple(void)
        counter = 1;
        io_loop_run(ioloop);
 
-       i_stream_read(right_in);
+       test_assert(i_stream_read(right_in) > 0);
        test_assert(strcmp((const char*)i_stream_get_data(right_in, &bytes), "hello, world") == 0);
        i_stream_skip(right_in, bytes);
 
@@ -85,7 +85,7 @@ void test_iostream_proxy_simple(void)
        counter = 1;
        io_loop_run(ioloop);
 
-       i_stream_read(left_in);
+       test_assert(i_stream_read(left_in) > 0);
        test_assert(strcmp((const char*)i_stream_get_data(left_in, &bytes), "hello, world") == 0);
        i_stream_skip(left_in, bytes);