Skip to content

Commit b359f4b

Browse files
author
Markus Armbruster
committed
tests: Rename UserDefNativeListUnion to UserDefListUnion
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]>
1 parent 709395f commit b359f4b

File tree

6 files changed

+209
-209
lines changed

6 files changed

+209
-209
lines changed

tests/qapi-schema/qapi-schema-test.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@
113113
# for testing use of 'str' within alternates
114114
{ 'alternate': 'AltStrObj', 'data': { 's': 'str', 'o': 'TestStruct' } }
115115

116-
# for testing native lists
117-
{ 'union': 'UserDefNativeListUnion',
116+
# for testing lists
117+
{ 'union': 'UserDefListUnion',
118118
'data': { 'integer': ['int'],
119119
's8': ['int8'],
120120
's16': ['int16'],
@@ -147,7 +147,7 @@
147147
'returns': 'int' }
148148
{ 'command': 'guest-sync', 'data': { 'arg': 'any' }, 'returns': 'any' }
149149
{ 'command': 'boxed-struct', 'boxed': true, 'data': 'UserDefZero' }
150-
{ 'command': 'boxed-union', 'data': 'UserDefNativeListUnion', 'boxed': true }
150+
{ 'command': 'boxed-union', 'data': 'UserDefListUnion', 'boxed': true }
151151

152152
# Smoke test on out-of-band and allow-preconfig-test
153153
{ 'command': 'test-flags-command', 'allow-oob': true, 'allow-preconfig': true }

tests/qapi-schema/qapi-schema-test.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ object q_obj_sizeList-wrapper
144144
member data: sizeList optional=False
145145
object q_obj_anyList-wrapper
146146
member data: anyList optional=False
147-
enum UserDefNativeListUnionKind
147+
enum UserDefListUnionKind
148148
member integer
149149
member s8
150150
member s16
@@ -159,8 +159,8 @@ enum UserDefNativeListUnionKind
159159
member string
160160
member sizes
161161
member any
162-
object UserDefNativeListUnion
163-
member type: UserDefNativeListUnionKind optional=False
162+
object UserDefListUnion
163+
member type: UserDefListUnionKind optional=False
164164
tag type
165165
case integer: q_obj_intList-wrapper
166166
case s8: q_obj_int8List-wrapper
@@ -209,7 +209,7 @@ command guest-sync q_obj_guest-sync-arg -> any
209209
gen=True success_response=True boxed=False oob=False preconfig=False
210210
command boxed-struct UserDefZero -> None
211211
gen=True success_response=True boxed=True oob=False preconfig=False
212-
command boxed-union UserDefNativeListUnion -> None
212+
command boxed-union UserDefListUnion -> None
213213
gen=True success_response=True boxed=True oob=False preconfig=False
214214
command test-flags-command None -> None
215215
gen=True success_response=True boxed=False oob=True preconfig=True

tests/test-clone-visitor.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static void test_clone_alternate(void)
6363
qapi_free_AltEnumBool(s_dst);
6464
}
6565

66-
static void test_clone_native_list(void)
66+
static void test_clone_list_union(void)
6767
{
6868
uint8List *src, *dst;
6969
uint8List *tmp = NULL;
@@ -102,18 +102,18 @@ static void test_clone_empty(void)
102102

103103
static void test_clone_complex1(void)
104104
{
105-
UserDefNativeListUnion *src, *dst;
105+
UserDefListUnion *src, *dst;
106106

107-
src = g_new0(UserDefNativeListUnion, 1);
108-
src->type = USER_DEF_NATIVE_LIST_UNION_KIND_STRING;
107+
src = g_new0(UserDefListUnion, 1);
108+
src->type = USER_DEF_LIST_UNION_KIND_STRING;
109109

110-
dst = QAPI_CLONE(UserDefNativeListUnion, src);
110+
dst = QAPI_CLONE(UserDefListUnion, src);
111111
g_assert(dst);
112112
g_assert_cmpint(dst->type, ==, src->type);
113113
g_assert(!dst->u.string.data);
114114

115-
qapi_free_UserDefNativeListUnion(src);
116-
qapi_free_UserDefNativeListUnion(dst);
115+
qapi_free_UserDefListUnion(src);
116+
qapi_free_UserDefListUnion(dst);
117117
}
118118

119119
static void test_clone_complex2(void)
@@ -192,7 +192,7 @@ int main(int argc, char **argv)
192192

193193
g_test_add_func("/visitor/clone/struct", test_clone_struct);
194194
g_test_add_func("/visitor/clone/alternate", test_clone_alternate);
195-
g_test_add_func("/visitor/clone/native_list", test_clone_native_list);
195+
g_test_add_func("/visitor/clone/list_union", test_clone_list_union);
196196
g_test_add_func("/visitor/clone/empty", test_clone_empty);
197197
g_test_add_func("/visitor/clone/complex1", test_clone_complex1);
198198
g_test_add_func("/visitor/clone/complex2", test_clone_complex2);

tests/test-qmp-cmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void qmp_boxed_struct(UserDefZero *arg, Error **errp)
8787
{
8888
}
8989

90-
void qmp_boxed_union(UserDefNativeListUnion *arg, Error **errp)
90+
void qmp_boxed_union(UserDefListUnion *arg, Error **errp)
9191
{
9292
}
9393

0 commit comments

Comments
 (0)