diff options
author | Markus Armbruster | 2017-05-22 18:42:14 +0200 |
---|---|---|
committer | Markus Armbruster | 2017-05-31 16:04:05 +0200 |
commit | 8168ca8ea3699b9fca4d8c948c7fa6ecdedc4a97 (patch) | |
tree | aabf333374f1e7995ea807d068fb745f0baab59c /tests/test-clone-visitor.c | |
parent | qapi: Document visit_type_any() issues with keyval input (diff) | |
download | qemu-8168ca8ea3699b9fca4d8c948c7fa6ecdedc4a97.tar.gz qemu-8168ca8ea3699b9fca4d8c948c7fa6ecdedc4a97.tar.xz qemu-8168ca8ea3699b9fca4d8c948c7fa6ecdedc4a97.zip |
tests/qapi-schema: Avoid 'str' in alternate test cases
The next commit is going to make alternate members of type 'str'
conflict with other scalar types. Would break a few test cases that
don't actually require 'str'. Flip them from 'str' to 'bool' or
'EnumOne'.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1495471335-23707-4-git-send-email-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'tests/test-clone-visitor.c')
-rw-r--r-- | tests/test-clone-visitor.c | 23 |
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) |