From 57de9af06fe4afb6e5289a0465a1beb47774f4d7 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 14 Jan 2023 08:56:17 -0500 Subject: [PATCH] Improve the g_string_append_c test We should check the resulting string too. --- glib/tests/string.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/glib/tests/string.c b/glib/tests/string.c index 286608636..30362a71b 100644 --- a/glib/tests/string.c +++ b/glib/tests/string.c @@ -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); }