15 add_to_null(
void **state)
22 add_nothing(
void **state)
24 GString *buf = g_string_new(NULL);
28 assert_string_equal((
const char *) buf->str,
"");
31 assert_string_equal((
const char *) buf->str,
"");
34 g_string_append(buf,
"hello");
36 assert_string_equal((
const char *) buf->str,
"hello");
39 assert_string_equal((
const char *) buf->str,
"hello");
40 g_string_free(buf, TRUE);
44 add_words(
void **state)
46 GString *buf = g_string_new(NULL);
50 assert_string_equal((
const char *) buf->str,
"hello ");
54 assert_string_equal((
const char *) buf->str,
"hello world");
55 g_string_free(buf, TRUE);
59 stop_early(
void **state)
61 GString *buf = g_string_new(NULL);
65 assert_string_equal((
const char *) buf->str,
"hello");
66 g_string_free(buf, TRUE);
70 cmocka_unit_test(add_to_null),
71 cmocka_unit_test(add_nothing),
72 cmocka_unit_test(add_words),
73 cmocka_unit_test(stop_early))
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
void pcmk__g_strcat(GString *buffer,...) G_GNUC_NULL_TERMINATED
#define pcmk__assert_asserts(stmt)