From: Luiz Capitulino <lcapitulino@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, aliguori@us.ibm.com, mdroth@linux.vnet.ibm.com,
armbru@redhat.com
Subject: [Qemu-devel] [PATCH 08/21] qapi: add test cases for generated free functions
Date: Wed, 28 Sep 2011 11:44:32 -0300 [thread overview]
Message-ID: <1317221085-5825-9-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1317221085-5825-1-git-send-email-lcapitulino@redhat.com>
From: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
test-qmp-commands.c | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/test-qmp-commands.c b/test-qmp-commands.c
index f142cc6..7db38b6 100644
--- a/test-qmp-commands.c
+++ b/test-qmp-commands.c
@@ -98,6 +98,34 @@ static void test_dispatch_cmd_io(void)
QDECREF(req);
}
+/* test generated dealloc functions for generated types */
+static void test_dealloc_types(void)
+{
+ UserDefOne *ud1test, *ud1a, *ud1b;
+ UserDefOneList *ud1list;
+
+ ud1test = g_malloc0(sizeof(UserDefOne));
+ ud1test->integer = 42;
+ ud1test->string = strdup("hi there 42");
+
+ qapi_free_UserDefOne(ud1test);
+
+ ud1a = g_malloc0(sizeof(UserDefOne));
+ ud1a->integer = 43;
+ ud1a->string = strdup("hi there 43");
+
+ ud1b = g_malloc0(sizeof(UserDefOne));
+ ud1b->integer = 44;
+ ud1b->string = strdup("hi there 44");
+
+ ud1list = g_malloc0(sizeof(UserDefOneList));
+ ud1list->value = ud1a;
+ ud1list->next = g_malloc0(sizeof(UserDefOneList));
+ ud1list->next->value = ud1b;
+
+ qapi_free_UserDefOneList(ud1list);
+}
+
int main(int argc, char **argv)
{
g_test_init(&argc, &argv, NULL);
@@ -105,6 +133,7 @@ int main(int argc, char **argv)
g_test_add_func("/0.15/dispatch_cmd", test_dispatch_cmd);
g_test_add_func("/0.15/dispatch_cmd_error", test_dispatch_cmd_error);
g_test_add_func("/0.15/dispatch_cmd_io", test_dispatch_cmd_io);
+ g_test_add_func("/0.15/dealloc_types", test_dealloc_types);
module_call_init(MODULE_INIT_QAPI);
g_test_run();
--
1.7.7.rc0.72.g4b5ea
next prev parent reply other threads:[~2011-09-28 14:45 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-28 14:44 [Qemu-devel] [PATCH v1 00/21]: First round of QAPI conversions Luiz Capitulino
2011-09-28 14:44 ` [Qemu-devel] [PATCH 01/21] error: let error_is_type take a NULL error Luiz Capitulino
2011-09-28 14:44 ` [Qemu-devel] [PATCH 02/21] qerror: add qerror_report_err() Luiz Capitulino
2011-09-28 14:44 ` [Qemu-devel] [PATCH 03/21] qapi: add code generation support for middle mode Luiz Capitulino
2011-09-28 14:44 ` [Qemu-devel] [PATCH 04/21] qapi: use middle mode in QMP server Luiz Capitulino
2011-09-28 14:44 ` [Qemu-devel] [PATCH 05/21] qapi: fixup command generation for functions that return list types Luiz Capitulino
2011-09-28 14:44 ` [Qemu-devel] [PATCH 06/21] qapi: dealloc visitor, fix premature free and iteration logic Luiz Capitulino
2011-09-29 12:49 ` Anthony Liguori
2011-09-28 14:44 ` [Qemu-devel] [PATCH 07/21] qapi: generate qapi_free_* functions for *List types Luiz Capitulino
2011-09-29 12:50 ` Anthony Liguori
2011-09-28 14:44 ` Luiz Capitulino [this message]
2011-09-29 12:51 ` [Qemu-devel] [PATCH 08/21] qapi: add test cases for generated free functions Anthony Liguori
2011-09-28 14:44 ` [Qemu-devel] [PATCH 09/21] qapi: dealloc visitor, support freeing of nested lists Luiz Capitulino
2011-09-29 12:51 ` Anthony Liguori
2011-09-28 14:44 ` [Qemu-devel] [PATCH 10/21] qapi: modify visitor code generation for list iteration Luiz Capitulino
2011-09-29 12:53 ` Anthony Liguori
2011-09-28 14:44 ` [Qemu-devel] [PATCH 11/21] qapi: convert query-name Luiz Capitulino
2011-09-28 14:44 ` [Qemu-devel] [PATCH 12/21] qapi: Convert query-version Luiz Capitulino
2011-09-29 12:54 ` Anthony Liguori
2011-09-29 14:32 ` Luiz Capitulino
2011-09-29 14:42 ` Anthony Liguori
2011-09-28 14:44 ` [Qemu-devel] [PATCH 13/21] qapi: Convert query-kvm Luiz Capitulino
2011-09-28 14:44 ` [Qemu-devel] [PATCH 14/21] qapi: Convert query-status Luiz Capitulino
2011-09-29 20:11 ` Michael Roth
2011-09-28 14:44 ` [Qemu-devel] [PATCH 15/21] qapi: Convert query-uuid Luiz Capitulino
2011-09-28 14:44 ` [Qemu-devel] [PATCH 16/21] qapi: Convert query-chardev Luiz Capitulino
2011-09-29 19:17 ` Michael Roth
2011-09-28 14:44 ` [Qemu-devel] [PATCH 17/21] qapi: Convert query-commands Luiz Capitulino
2011-09-29 19:25 ` Michael Roth
2011-09-28 14:44 ` [Qemu-devel] [PATCH 18/21] qapi: Convert quit Luiz Capitulino
2011-09-28 14:44 ` [Qemu-devel] [PATCH 19/21] qapi: Convert stop Luiz Capitulino
2011-09-28 14:44 ` [Qemu-devel] [PATCH 20/21] qapi: Convert system_reset Luiz Capitulino
2011-09-28 14:44 ` [Qemu-devel] [PATCH 21/21] qapi: Convert system_powerdown Luiz Capitulino
2011-09-29 12:55 ` [Qemu-devel] [PATCH v1 00/21]: First round of QAPI conversions Anthony Liguori
2011-09-29 13:52 ` Luiz Capitulino
2011-09-29 20:15 ` Michael Roth
2011-09-29 20:57 ` Luiz Capitulino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1317221085-5825-9-git-send-email-lcapitulino@redhat.com \
--to=lcapitulino@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).