[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/10] utests: Add qstring_append_chr() unit-test
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 05/10] utests: Add qstring_append_chr() unit-test |
Date: |
Tue, 17 Nov 2009 17:43:52 -0200 |
Signed-off-by: Luiz Capitulino <address@hidden>
---
check-qstring.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/check-qstring.c b/check-qstring.c
index ea4dfd0..412038a 100644
--- a/check-qstring.c
+++ b/check-qstring.c
@@ -55,6 +55,22 @@ START_TEST(qstring_get_str_test)
}
END_TEST
+START_TEST(qstring_append_chr_test)
+{
+ int i;
+ QString *qstring;
+ const char *str = "qstring append char unit-test";
+
+ qstring = qstring_new();
+
+ for (i = 0; str[i]; i++)
+ qstring_append_chr(qstring, str[i]);
+
+ fail_unless(strcmp(str, qstring_get_str(qstring)) == 0);
+ QDECREF(qstring);
+}
+END_TEST
+
START_TEST(qobject_to_qstring_test)
{
QString *qstring;
@@ -78,6 +94,7 @@ static Suite *qstring_suite(void)
tcase_add_test(qstring_public_tcase, qstring_from_str_test);
tcase_add_test(qstring_public_tcase, qstring_destroy_test);
tcase_add_test(qstring_public_tcase, qstring_get_str_test);
+ tcase_add_test(qstring_public_tcase, qstring_append_chr_test);
tcase_add_test(qstring_public_tcase, qobject_to_qstring_test);
return s;
--
1.6.5.2.180.gc5b3e
- [Qemu-devel] [PATCH 00/10]: QError v4, Luiz Capitulino, 2009/11/17
- [Qemu-devel] [PATCH 01/10] QJSON: Introduce qobject_from_jsonv(), Luiz Capitulino, 2009/11/17
- [Qemu-devel] [PATCH 02/10] QString: Introduce qstring_append_chr(), Luiz Capitulino, 2009/11/17
- [Qemu-devel] [PATCH 03/10] QString: Introduce qstring_append_int(), Luiz Capitulino, 2009/11/17
- [Qemu-devel] [PATCH 04/10] QString: Introduce qstring_from_substr(), Luiz Capitulino, 2009/11/17
- [Qemu-devel] [PATCH 05/10] utests: Add qstring_append_chr() unit-test,
Luiz Capitulino <=
- [Qemu-devel] [PATCH 06/10] utests: Add qstring_from_substr() unit-test, Luiz Capitulino, 2009/11/17
- [Qemu-devel] [PATCH 07/10] Introduce QError, Luiz Capitulino, 2009/11/17
- Re: [Qemu-devel] [PATCH 07/10] Introduce QError, Daniel P. Berrange, 2009/11/18
[Qemu-devel] [PATCH 10/10] monitor: do_info_balloon(): use QError, Luiz Capitulino, 2009/11/17