diff options
author | Markus Armbruster <armbru@redhat.com> | 2014-03-01 08:40:28 +0100 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2014-03-03 11:16:45 -0500 |
commit | ab22ad96cea4300a92b400b0c46af2f50a037362 (patch) | |
tree | a041a0afd339079cf844bfecfdf9afce0ea8d64e /tests/test-qmp-commands.c | |
parent | 357765fed57de3204cb259db3ffa3737e33ca5c0 (diff) | |
download | qemu-ab22ad96cea4300a92b400b0c46af2f50a037362.zip qemu-ab22ad96cea4300a92b400b0c46af2f50a037362.tar.gz qemu-ab22ad96cea4300a92b400b0c46af2f50a037362.tar.bz2 |
tests/qapi-schema: Cover optional command arguments
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'tests/test-qmp-commands.c')
-rw-r--r-- | tests/test-qmp-commands.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test-qmp-commands.c b/tests/test-qmp-commands.c index d039b87..d7720ab 100644 --- a/tests/test-qmp-commands.c +++ b/tests/test-qmp-commands.c @@ -16,7 +16,9 @@ void qmp_user_def_cmd1(UserDefOne * ud1, Error **errp) { } -UserDefTwo * qmp_user_def_cmd2(UserDefOne * ud1a, UserDefOne * ud1b, Error **errp) +UserDefTwo *qmp_user_def_cmd2(UserDefOne *ud1a, + bool has_udb1, UserDefOne *ud1b, + Error **errp) { UserDefTwo *ret; UserDefOne *ud1c = g_malloc0(sizeof(UserDefOne)); @@ -24,8 +26,8 @@ UserDefTwo * qmp_user_def_cmd2(UserDefOne * ud1a, UserDefOne * ud1b, Error **err ud1c->string = strdup(ud1a->string); ud1c->integer = ud1a->integer; - ud1d->string = strdup(ud1b->string); - ud1d->integer = ud1b->integer; + ud1d->string = strdup(has_udb1 ? ud1b->string : "blah0"); + ud1d->integer = has_udb1 ? ud1b->integer : 0; ret = g_malloc0(sizeof(UserDefTwo)); ret->string = strdup("blah1"); |