aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile1
-rw-r--r--tests/qapi-schema/qapi-schema-test.json2
-rw-r--r--tests/qapi-schema/union-clash-data.err0
-rw-r--r--tests/qapi-schema/union-clash-data.exit1
-rw-r--r--tests/qapi-schema/union-clash-data.json7
-rw-r--r--tests/qapi-schema/union-clash-data.out9
-rw-r--r--tests/test-io-channel-socket.c34
-rw-r--r--tests/test-opts-visitor.c10
8 files changed, 23 insertions, 41 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 04e34b5c7e..cd4bbd41ad 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -358,7 +358,6 @@ qapi-schema += unicode-str.json
qapi-schema += union-base-no-discriminator.json
qapi-schema += union-branch-case.json
qapi-schema += union-clash-branches.json
-qapi-schema += union-clash-data.json
qapi-schema += union-empty.json
qapi-schema += union-invalid-base.json
qapi-schema += union-optional-branch.json
diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qapi-schema-test.json
index 632964a6ec..728659e68a 100644
--- a/tests/qapi-schema/qapi-schema-test.json
+++ b/tests/qapi-schema/qapi-schema-test.json
@@ -77,7 +77,7 @@
'base': 'UserDefZero',
'data': { 'string': 'str', 'enum1': 'QEnumTwo' } }
-# this variant of UserDefFlatUnion defaults to a union that uses fields with
+# this variant of UserDefFlatUnion defaults to a union that uses members with
# allocated types to test corner cases in the cleanup/dealloc visitor
{ 'union': 'UserDefFlatUnion2',
'base': 'UserDefUnionBase2',
diff --git a/tests/qapi-schema/union-clash-data.err b/tests/qapi-schema/union-clash-data.err
deleted file mode 100644
index e69de29bb2..0000000000
--- a/tests/qapi-schema/union-clash-data.err
+++ /dev/null
diff --git a/tests/qapi-schema/union-clash-data.exit b/tests/qapi-schema/union-clash-data.exit
deleted file mode 100644
index 573541ac97..0000000000
--- a/tests/qapi-schema/union-clash-data.exit
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/tests/qapi-schema/union-clash-data.json b/tests/qapi-schema/union-clash-data.json
deleted file mode 100644
index 7308e69f9c..0000000000
--- a/tests/qapi-schema/union-clash-data.json
+++ /dev/null
@@ -1,7 +0,0 @@
-# Union branch 'data'
-# FIXME: this parses, but then fails to compile due to a duplicate 'data'
-# (one from the branch name, another as a filler to avoid an empty union).
-# we should either detect the collision at parse time, or change the
-# generated struct to allow this to compile.
-{ 'union': 'TestUnion',
- 'data': { 'data': 'int' } }
diff --git a/tests/qapi-schema/union-clash-data.out b/tests/qapi-schema/union-clash-data.out
deleted file mode 100644
index f5752f4595..0000000000
--- a/tests/qapi-schema/union-clash-data.out
+++ /dev/null
@@ -1,9 +0,0 @@
-object :empty
-object :obj-int-wrapper
- member data: int optional=False
-enum QType ['none', 'qnull', 'qint', 'qstring', 'qdict', 'qlist', 'qfloat', 'qbool']
- prefix QTYPE
-object TestUnion
- member type: TestUnionKind optional=False
- case data: :obj-int-wrapper
-enum TestUnionKind ['data']
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);
diff --git a/tests/test-opts-visitor.c b/tests/test-opts-visitor.c
index b7acf7d294..297a02d6a2 100644
--- a/tests/test-opts-visitor.c
+++ b/tests/test-opts-visitor.c
@@ -17,7 +17,6 @@
#include "qemu/option.h" /* qemu_opts_parse() */
#include "qapi/opts-visitor.h" /* opts_visitor_new() */
#include "test-qapi-visit.h" /* visit_type_UserDefOptions() */
-#include "qapi/dealloc-visitor.h" /* qapi_dealloc_visitor_new() */
static QemuOptsList userdef_opts = {
.name = "userdef",
@@ -55,14 +54,7 @@ setup_fixture(OptsVisitorFixture *f, gconstpointer test_data)
static void
teardown_fixture(OptsVisitorFixture *f, gconstpointer test_data)
{
- if (f->userdef != NULL) {
- QapiDeallocVisitor *dv;
-
- dv = qapi_dealloc_visitor_new();
- visit_type_UserDefOptions(qapi_dealloc_get_visitor(dv), NULL,
- &f->userdef, NULL);
- qapi_dealloc_visitor_cleanup(dv);
- }
+ qapi_free_UserDefOptions(f->userdef);
error_free(f->err);
}