summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2009-11-18 23:05:28 -0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 09:41:19 -0600
commitf08932c8802607f9391d5c79b5ed53c8090cd6cd (patch)
tree0c1a4231be875d6306f36d2998eb41ddcd9cf722 /check-qstring.c
parentQString: Introduce qstring_from_substr() (diff)
downloadqemu-kvm-f08932c8802607f9391d5c79b5ed53c8090cd6cd.tar.gz
qemu-kvm-f08932c8802607f9391d5c79b5ed53c8090cd6cd.tar.bz2
qemu-kvm-f08932c8802607f9391d5c79b5ed53c8090cd6cd.zip
utests: Add qstring_append_chr() unit-test
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'check-qstring.c')
-rw-r--r--check-qstring.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/check-qstring.c b/check-qstring.c
index ea4dfd03c..412038adb 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;