diff options
| author | Daniel P. Berrange | 2016-03-08 16:26:39 +0100 |
|---|---|---|
| committer | Daniel P. Berrange | 2016-03-10 18:10:18 +0100 |
| commit | a9d5aed12d0cf067e87eda14e794cda022381e1b (patch) | |
| tree | 03e91ccb6ed8b304aa3be33fe0d240bb8fdd933d /tests/test-io-channel-socket.c | |
| parent | io: bind to socket before creating QIOChannelSocket (diff) | |
| download | qemu-a9d5aed12d0cf067e87eda14e794cda022381e1b.tar.gz qemu-a9d5aed12d0cf067e87eda14e794cda022381e1b.tar.xz qemu-a9d5aed12d0cf067e87eda14e794cda022381e1b.zip | |
io: wait for incoming client in socket test
Exercise the GSource code for server sockets by calling
qio_channel_wait() prior to accepting the incoming client.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'tests/test-io-channel-socket.c')
| -rw-r--r-- | tests/test-io-channel-socket.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test-io-channel-socket.c b/tests/test-io-channel-socket.c index 4c16da1add..ae665f5ea0 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); |
