Implement test_string_append
This commit is contained in:
parent
4316c85e18
commit
8b11113be1
24
test/utils.c
24
test/utils.c
@ -72,7 +72,29 @@ TEST test_string_replace(void)
|
|||||||
|
|
||||||
TEST test_string_append(void)
|
TEST test_string_append(void)
|
||||||
{
|
{
|
||||||
SKIP(); //TODO: Implement this
|
char *exp;
|
||||||
|
|
||||||
|
ASSERT_STR_EQ("text_sep_bit", (exp = string_append(g_strdup("text"), "bit", "_sep_")));
|
||||||
|
g_free(exp);
|
||||||
|
ASSERT_STR_EQ("textbit", (exp = string_append(g_strdup("text"), "bit", NULL)));
|
||||||
|
g_free(exp);
|
||||||
|
ASSERT_STR_EQ("textbit", (exp = string_append(g_strdup("text"), "bit", "")));
|
||||||
|
g_free(exp);
|
||||||
|
|
||||||
|
ASSERT_STR_EQ("text", (exp = string_append(g_strdup("text"), "", NULL)));
|
||||||
|
g_free(exp);
|
||||||
|
|
||||||
|
ASSERT_STR_EQ("b", (exp = string_append(g_strdup(""), "b", NULL)));
|
||||||
|
g_free(exp);
|
||||||
|
ASSERT_STR_EQ("b", (exp = string_append(NULL, "b", "_sep_")));
|
||||||
|
g_free(exp);
|
||||||
|
|
||||||
|
ASSERT_STR_EQ("a", (exp = string_append(g_strdup("a"), "", NULL)));
|
||||||
|
g_free(exp);
|
||||||
|
|
||||||
|
ASSERT_EQ(NULL, (exp = string_append(NULL, NULL, "_sep_")));
|
||||||
|
g_free(exp);
|
||||||
|
|
||||||
PASS();
|
PASS();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user