提交 f08932c8 编写于 作者: L Luiz Capitulino 提交者: Anthony Liguori

utests: Add qstring_append_chr() unit-test

Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 4b5c5766
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册