summaryrefslogtreecommitdiffstats
path: root/tests/test-qmp-input-visitor.c
diff options
context:
space:
mode:
authorPeter Maydell2015-09-04 16:53:48 +0200
committerPeter Maydell2015-09-04 16:53:48 +0200
commitb5bff7518d8e4feda95f5c523cb24f72863c1df6 (patch)
tree28406ac68a1d1b57eb2e664432e8a3186db8bc87 /tests/test-qmp-input-visitor.c
parentMerge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' int... (diff)
parentqapi: Generators crash when --output-dir isn't given, fix (diff)
downloadqemu-b5bff7518d8e4feda95f5c523cb24f72863c1df6.tar.gz
qemu-b5bff7518d8e4feda95f5c523cb24f72863c1df6.tar.xz
qemu-b5bff7518d8e4feda95f5c523cb24f72863c1df6.zip
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2015-09-04' into staging
qapi: Another round of fixes and cleanups # gpg: Signature made Fri 04 Sep 2015 14:48:54 BST 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-2015-09-04: (33 commits) qapi: Generators crash when --output-dir isn't given, fix docs/qapi-code-gen.txt: Fix QAPI schema examples qapi: Simplify error reporting for array types qapi: Fix errors for non-string, non-dictionary members tests/qapi-schema: Cover non-string, non-dictionary members tests/qapi-schema: Cover two more syntax errors qapi: Drop one of two "simple union must not have base" checks qapi: Generated code cleanup qapi-commands: Drop useless initialization qapi-commands: Don't feed output of mcgen() to mcgen() again qapi-commands: Inline gen_marshal_output_call() qapi-commands: Fix gen_err_check(e) for e and e != 'local_err' qapi: Command returning anonymous type doesn't work, outlaw qapi: Fix to reject union command and event arguments qapi-tests: New tests for union, alternate command arguments tests/qapi-schema: Rename tests from data- to args- tests/qapi-schema: Restore test case for flat union base bug qapi: Document flaws in checking of names qapi: Document shortcoming with union 'data' branch qapi: Document that input visitor semantics are prone to leaks ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests/test-qmp-input-visitor.c')
-rw-r--r--tests/test-qmp-input-visitor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test-qmp-input-visitor.c b/tests/test-qmp-input-visitor.c
index b96195309b..a5cfefae8b 100644
--- a/tests/test-qmp-input-visitor.c
+++ b/tests/test-qmp-input-visitor.c
@@ -313,7 +313,7 @@ static void test_visitor_in_union_flat(TestInputVisitorData *data,
visit_type_UserDefFlatUnion(v, &tmp, NULL, &err);
g_assert(err == NULL);
- g_assert_cmpint(tmp->kind, ==, ENUM_ONE_VALUE1);
+ g_assert_cmpint(tmp->enum1, ==, ENUM_ONE_VALUE1);
g_assert_cmpstr(tmp->string, ==, "str");
/* TODO g_assert_cmpint(tmp->integer, ==, 41); */
g_assert_cmpint(tmp->value1->boolean, ==, true);
@@ -636,6 +636,8 @@ static void test_visitor_in_errors(TestInputVisitorData *data,
visit_type_TestStruct(v, &p, NULL, &err);
g_assert(err);
+ /* FIXME - a failed parse should not leave a partially-allocated p
+ * for us to clean up; this could cause callers to leak memory. */
g_assert(p->string == NULL);
error_free(err);