From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adhui-00082X-Ov for qemu-devel@nongnu.org; Wed, 09 Mar 2016 12:28:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adhud-0005w4-G9 for qemu-devel@nongnu.org; Wed, 09 Mar 2016 12:28:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adhud-0005vz-By for qemu-devel@nongnu.org; Wed, 09 Mar 2016 12:28:43 -0500 From: "Daniel P. Berrange" Date: Wed, 9 Mar 2016 17:28:08 +0000 Message-Id: <1457544504-8548-6-git-send-email-berrange@redhat.com> In-Reply-To: <1457544504-8548-1-git-send-email-berrange@redhat.com> References: <1457544504-8548-1-git-send-email-berrange@redhat.com> Subject: [Qemu-devel] [PATCH v1 05/21] io: wait for incoming client in socket test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Andrew Baumann , Stefan Weil Exercise the GSource code for server sockets by calling qio_channel_wait() prior to accepting the incoming client. Signed-off-by: Daniel P. Berrange --- tests/test-io-channel-socket.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-io-channel-socket.c b/tests/test-io-channel-socket.c index 4c16da1..ae665f5 100644 --- a/tests/test-io-channel-socket.c +++ b/tests/test-io-channel-socket.c @@ -114,6 +114,7 @@ static void test_io_channel_setup_sync(SocketAddress *listen_addr, QIO_CHANNEL_SOCKET(*src), connect_addr, &error_abort); qio_channel_set_delay(*src, false); + qio_channel_wait(QIO_CHANNEL(lioc), G_IO_IN); *dst = QIO_CHANNEL(qio_channel_socket_accept(lioc, &error_abort)); g_assert(*dst); @@ -181,6 +182,7 @@ static void test_io_channel_setup_async(SocketAddress *listen_addr, g_assert(!data.err); + qio_channel_wait(QIO_CHANNEL(lioc), G_IO_IN); *dst = QIO_CHANNEL(qio_channel_socket_accept(lioc, &error_abort)); g_assert(*dst); -- 2.5.0