summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOle André Vadla Ravnås <oleavr@gmail.com>2021-05-16 00:22:19 +0200
committerOlivier Crête <olivier.crete@ocrete.ca>2021-11-22 21:53:08 +0000
commitb590a4128af0f9a2c5b8e9a295a6dfa85bb17c5c (patch)
tree909a49a2f95cd40643fe17b013d10142c44f5d0f
parente22aaa74ecf7d193450991dfc7c6657f6b092139 (diff)
downloadlibnice-b590a4128af0f9a2c5b8e9a295a6dfa85bb17c5c.tar.gz
test-io-stream-thread: Handle partial I/O
-rw-r--r--tests/test-io-stream-thread.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test-io-stream-thread.c b/tests/test-io-stream-thread.c
index b4b96ed..c722530 100644
--- a/tests/test-io-stream-thread.c
+++ b/tests/test-io-stream-thread.c
@@ -67,12 +67,11 @@ read_thread_cb (GInputStream *input_stream, TestIOStreamThreadData *data)
guint8 expected_data[MESSAGE_SIZE];
GError *error = NULL;
guint8 buf[MESSAGE_SIZE];
- gssize len;
/* Block on receiving some data. */
- len = g_input_stream_read (input_stream, buf, sizeof (buf), NULL, &error);
+ g_input_stream_read_all (input_stream, buf, sizeof (buf), NULL, NULL,
+ &error);
g_assert_no_error (error);
- g_assert_cmpint (len, ==, sizeof (buf));
memset (expected_data, user_data->recv_count + '1', sizeof (expected_data));
g_assert_cmpmem (buf, sizeof (expected_data), expected_data,
@@ -105,7 +104,8 @@ write_thread_cb (GOutputStream *output_stream, TestIOStreamThreadData *data)
memset (buf, user_data->send_count + '1', MESSAGE_SIZE);
- g_output_stream_write (output_stream, buf, sizeof (buf), NULL, &error);
+ g_output_stream_write_all (output_stream, buf, sizeof (buf), NULL, NULL,
+ &error);
g_assert_no_error (error);
}
}