summaryrefslogtreecommitdiffstats
path: root/tests/test-clone-visitor.c
diff options
context:
space:
mode:
authorPeter Maydell2017-06-01 17:39:16 +0200
committerPeter Maydell2017-06-01 17:39:16 +0200
commit43771d5d92312504305c19abe29ec5bfabd55f01 (patch)
tree9dc7719fb3b71f42f669b190126b1cf4731a1d08 /tests/test-clone-visitor.c
parentMerge remote-tracking branch 'remotes/riku/tags/pull-linux-user-20170531' int... (diff)
parentqapi: Reject alternates that can't work with keyval_parse() (diff)
downloadqemu-43771d5d92312504305c19abe29ec5bfabd55f01.tar.gz
qemu-43771d5d92312504305c19abe29ec5bfabd55f01.tar.xz
qemu-43771d5d92312504305c19abe29ec5bfabd55f01.zip
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2017-05-31' into staging
QAPI patches for 2017-05-31 # gpg: Signature made Wed 31 May 2017 18:06:39 BST # gpg: using RSA key 0x3870B400EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-qapi-2017-05-31: qapi: Reject alternates that can't work with keyval_parse() tests/qapi-schema: Avoid 'str' in alternate test cases qapi: Document visit_type_any() issues with keyval input qobject-input-visitor: Reject non-finite numbers with keyval Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests/test-clone-visitor.c')
-rw-r--r--tests/test-clone-visitor.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/tests/test-clone-visitor.c b/tests/test-clone-visitor.c
index df0c045512..96982163e4 100644
--- a/tests/test-clone-visitor.c
+++ b/tests/test-clone-visitor.c
@@ -42,29 +42,28 @@ static void test_clone_struct(void)
static void test_clone_alternate(void)
{
- AltStrBool *b_src, *s_src, *b_dst, *s_dst;
+ AltEnumBool *b_src, *s_src, *b_dst, *s_dst;
- b_src = g_new0(AltStrBool, 1);
+ b_src = g_new0(AltEnumBool, 1);
b_src->type = QTYPE_QBOOL;
b_src->u.b = true;
- s_src = g_new0(AltStrBool, 1);
+ s_src = g_new0(AltEnumBool, 1);
s_src->type = QTYPE_QSTRING;
- s_src->u.s = g_strdup("World");
+ s_src->u.e = ENUM_ONE_VALUE1;
- b_dst = QAPI_CLONE(AltStrBool, b_src);
+ b_dst = QAPI_CLONE(AltEnumBool, b_src);
g_assert(b_dst);
g_assert_cmpint(b_dst->type, ==, b_src->type);
g_assert_cmpint(b_dst->u.b, ==, b_src->u.b);
- s_dst = QAPI_CLONE(AltStrBool, s_src);
+ s_dst = QAPI_CLONE(AltEnumBool, s_src);
g_assert(s_dst);
g_assert_cmpint(s_dst->type, ==, s_src->type);
- g_assert_cmpstr(s_dst->u.s, ==, s_src->u.s);
- g_assert(s_dst->u.s != s_src->u.s);
+ g_assert_cmpint(s_dst->u.e, ==, s_src->u.e);
- qapi_free_AltStrBool(b_src);
- qapi_free_AltStrBool(s_src);
- qapi_free_AltStrBool(b_dst);
- qapi_free_AltStrBool(s_dst);
+ qapi_free_AltEnumBool(b_src);
+ qapi_free_AltEnumBool(s_src);
+ qapi_free_AltEnumBool(b_dst);
+ qapi_free_AltEnumBool(s_dst);
}
static void test_clone_native_list(void)