Skip to content

Commit

Permalink
tests: Rename UserDefNativeListUnion to UserDefListUnion
Browse files Browse the repository at this point in the history
The lists in UserDefNativeListUnion aren't "native", they're lists of
built-in types.  The next commit will add a list of a user-defined
type.  Drop "Native", and adjust the tests using the type.

Signed-off-by: Markus Armbruster <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
  • Loading branch information
Markus Armbruster committed Mar 5, 2019
1 parent 709395f commit b359f4b
Show file tree
Hide file tree
Showing 6 changed files with 209 additions and 209 deletions.
6 changes: 3 additions & 3 deletions tests/qapi-schema/qapi-schema-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
# for testing use of 'str' within alternates
{ 'alternate': 'AltStrObj', 'data': { 's': 'str', 'o': 'TestStruct' } }

# for testing native lists
{ 'union': 'UserDefNativeListUnion',
# for testing lists
{ 'union': 'UserDefListUnion',
'data': { 'integer': ['int'],
's8': ['int8'],
's16': ['int16'],
Expand Down Expand Up @@ -147,7 +147,7 @@
'returns': 'int' }
{ 'command': 'guest-sync', 'data': { 'arg': 'any' }, 'returns': 'any' }
{ 'command': 'boxed-struct', 'boxed': true, 'data': 'UserDefZero' }
{ 'command': 'boxed-union', 'data': 'UserDefNativeListUnion', 'boxed': true }
{ 'command': 'boxed-union', 'data': 'UserDefListUnion', 'boxed': true }

# Smoke test on out-of-band and allow-preconfig-test
{ 'command': 'test-flags-command', 'allow-oob': true, 'allow-preconfig': true }
Expand Down
8 changes: 4 additions & 4 deletions tests/qapi-schema/qapi-schema-test.out
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ object q_obj_sizeList-wrapper
member data: sizeList optional=False
object q_obj_anyList-wrapper
member data: anyList optional=False
enum UserDefNativeListUnionKind
enum UserDefListUnionKind
member integer
member s8
member s16
Expand All @@ -159,8 +159,8 @@ enum UserDefNativeListUnionKind
member string
member sizes
member any
object UserDefNativeListUnion
member type: UserDefNativeListUnionKind optional=False
object UserDefListUnion
member type: UserDefListUnionKind optional=False
tag type
case integer: q_obj_intList-wrapper
case s8: q_obj_int8List-wrapper
Expand Down Expand Up @@ -209,7 +209,7 @@ command guest-sync q_obj_guest-sync-arg -> any
gen=True success_response=True boxed=False oob=False preconfig=False
command boxed-struct UserDefZero -> None
gen=True success_response=True boxed=True oob=False preconfig=False
command boxed-union UserDefNativeListUnion -> None
command boxed-union UserDefListUnion -> None
gen=True success_response=True boxed=True oob=False preconfig=False
command test-flags-command None -> None
gen=True success_response=True boxed=False oob=True preconfig=True
Expand Down
16 changes: 8 additions & 8 deletions tests/test-clone-visitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static void test_clone_alternate(void)
qapi_free_AltEnumBool(s_dst);
}

static void test_clone_native_list(void)
static void test_clone_list_union(void)
{
uint8List *src, *dst;
uint8List *tmp = NULL;
Expand Down Expand Up @@ -102,18 +102,18 @@ static void test_clone_empty(void)

static void test_clone_complex1(void)
{
UserDefNativeListUnion *src, *dst;
UserDefListUnion *src, *dst;

src = g_new0(UserDefNativeListUnion, 1);
src->type = USER_DEF_NATIVE_LIST_UNION_KIND_STRING;
src = g_new0(UserDefListUnion, 1);
src->type = USER_DEF_LIST_UNION_KIND_STRING;

dst = QAPI_CLONE(UserDefNativeListUnion, src);
dst = QAPI_CLONE(UserDefListUnion, src);
g_assert(dst);
g_assert_cmpint(dst->type, ==, src->type);
g_assert(!dst->u.string.data);

qapi_free_UserDefNativeListUnion(src);
qapi_free_UserDefNativeListUnion(dst);
qapi_free_UserDefListUnion(src);
qapi_free_UserDefListUnion(dst);
}

static void test_clone_complex2(void)
Expand Down Expand Up @@ -192,7 +192,7 @@ int main(int argc, char **argv)

g_test_add_func("/visitor/clone/struct", test_clone_struct);
g_test_add_func("/visitor/clone/alternate", test_clone_alternate);
g_test_add_func("/visitor/clone/native_list", test_clone_native_list);
g_test_add_func("/visitor/clone/list_union", test_clone_list_union);
g_test_add_func("/visitor/clone/empty", test_clone_empty);
g_test_add_func("/visitor/clone/complex1", test_clone_complex1);
g_test_add_func("/visitor/clone/complex2", test_clone_complex2);
Expand Down
2 changes: 1 addition & 1 deletion tests/test-qmp-cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void qmp_boxed_struct(UserDefZero *arg, Error **errp)
{
}

void qmp_boxed_union(UserDefNativeListUnion *arg, Error **errp)
void qmp_boxed_union(UserDefListUnion *arg, Error **errp)
{
}

Expand Down
Loading

0 comments on commit b359f4b

Please sign in to comment.