aboutsummaryrefslogtreecommitdiff
path: root/tests/test-io-channel-socket.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-03-06 11:53:27 +0000
committerPeter Maydell <peter.maydell@linaro.org>2016-03-06 11:53:27 +0000
commit1464ad45cd6cdeb0b5c1a54d3d3791396e47e52f (patch)
tree12e5fa81ad1f1cf455c598a5351c1b4248b38b84 /tests/test-io-channel-socket.c
parent3c0f12df65da872d5fbccae469f2cb21ed1c03b7 (diff)
parent48eb62a74fc2d6b0ae9e5f414304a85cfbf33066 (diff)
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2016-03-04' into staging
QAPI patches for 2016-03-04 # gpg: Signature made Sat 05 Mar 2016 09:47:19 GMT using RSA key ID EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" * remotes/armbru/tags/pull-qapi-2016-03-04: qapi: Drop useless 'data' member of unions chardev: Drop useless ChardevDummy type qapi: Avoid use of 'data' member of QAPI unions ui: Shorten references into InputEvent util: Shorten references into SocketAddress chardev: Shorten references into ChardevBackend qapi: Update docs to match recent generator changes qapi-visit: Expose visit_type_FOO_members() qapi: Rename 'fields' to 'members' in generated C code qapi: Rename 'fields' to 'members' in generator qapi-dealloc: Reduce use outside of generated code qmp-shell: fix pretty printing of JSON responses Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests/test-io-channel-socket.c')
-rw-r--r--tests/test-io-channel-socket.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/tests/test-io-channel-socket.c b/tests/test-io-channel-socket.c
index 069736373c..8a34056670 100644
--- a/tests/test-io-channel-socket.c
+++ b/tests/test-io-channel-socket.c
@@ -1,7 +1,7 @@
/*
* QEMU I/O channel sockets test
*
- * Copyright (c) 2015 Red Hat, Inc.
+ * Copyright (c) 2015-2016 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -283,14 +283,18 @@ static void test_io_channel_ipv4(bool async)
SocketAddress *connect_addr = g_new0(SocketAddress, 1);
listen_addr->type = SOCKET_ADDRESS_KIND_INET;
- listen_addr->u.inet = g_new0(InetSocketAddress, 1);
- listen_addr->u.inet->host = g_strdup("127.0.0.1");
- listen_addr->u.inet->port = NULL; /* Auto-select */
+ listen_addr->u.inet = g_new(InetSocketAddress, 1);
+ *listen_addr->u.inet = (InetSocketAddress) {
+ .host = g_strdup("127.0.0.1"),
+ .port = NULL, /* Auto-select */
+ };
connect_addr->type = SOCKET_ADDRESS_KIND_INET;
- connect_addr->u.inet = g_new0(InetSocketAddress, 1);
- connect_addr->u.inet->host = g_strdup("127.0.0.1");
- connect_addr->u.inet->port = NULL; /* Filled in later */
+ connect_addr->u.inet = g_new(InetSocketAddress, 1);
+ *connect_addr->u.inet = (InetSocketAddress) {
+ .host = g_strdup("127.0.0.1"),
+ .port = NULL, /* Filled in later */
+ };
test_io_channel(async, listen_addr, connect_addr, false);
@@ -317,14 +321,18 @@ static void test_io_channel_ipv6(bool async)
SocketAddress *connect_addr = g_new0(SocketAddress, 1);
listen_addr->type = SOCKET_ADDRESS_KIND_INET;
- listen_addr->u.inet = g_new0(InetSocketAddress, 1);
- listen_addr->u.inet->host = g_strdup("::1");
- listen_addr->u.inet->port = NULL; /* Auto-select */
+ listen_addr->u.inet = g_new(InetSocketAddress, 1);
+ *listen_addr->u.inet = (InetSocketAddress) {
+ .host = g_strdup("::1"),
+ .port = NULL, /* Auto-select */
+ };
connect_addr->type = SOCKET_ADDRESS_KIND_INET;
- connect_addr->u.inet = g_new0(InetSocketAddress, 1);
- connect_addr->u.inet->host = g_strdup("::1");
- connect_addr->u.inet->port = NULL; /* Filled in later */
+ connect_addr->u.inet = g_new(InetSocketAddress, 1);
+ *connect_addr->u.inet = (InetSocketAddress) {
+ .host = g_strdup("::1"),
+ .port = NULL, /* Filled in later */
+ };
test_io_channel(async, listen_addr, connect_addr, false);