Improve the g_string_append_c test

We should check the resulting string too.
This commit is contained in:
Matthias Clasen 2023-01-14 08:56:17 -05:00
parent 9810803358
commit 57de9af06f

View File

@ -193,8 +193,11 @@ test_string_append_c (void)
else
(g_string_append_c) (string, 'a'+(i%26));
g_assert((strlen("hi pete!") + 10000) == string->len);
g_assert((strlen("hi pete!") + 10000) == strlen(string->str));
g_assert_true ((strlen("hi pete!") + 10000) == string->len);
g_assert_true ((strlen("hi pete!") + 10000) == strlen(string->str));
for (i = 0; i < 10000; i++)
g_assert_true (string->str[strlen ("Hi pete!") + i] == 'a' + (i%26));
g_string_free (string, TRUE);
}