From: Timo Sirainen Date: Sun, 18 Aug 2019 14:44:33 +0000 (+0300) Subject: lib, lib-dcrypt: Fix unit tests to check i_stream_read() return value X-Git-Tag: 2.3.9~305 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67cee4581b8d367296ffa1522836610ec3418a0f;p=thirdparty%2Fdovecot%2Fcore.git lib, lib-dcrypt: Fix unit tests to check i_stream_read() return value --- diff --git a/src/lib-dcrypt/test-stream.c b/src/lib-dcrypt/test-stream.c index 153e8b77bc..aeed1f75bc 100644 --- a/src/lib-dcrypt/test-stream.c +++ b/src/lib-dcrypt/test-stream.c @@ -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; diff --git a/src/lib/test-iostream-proxy.c b/src/lib/test-iostream-proxy.c index d35008d378..9086c5d26f 100644 --- a/src/lib/test-iostream-proxy.c +++ b/src/lib/test-iostream-proxy.c @@ -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);