diff options
author | Simon McVittie <smcv@collabora.com> | 2021-08-02 11:22:17 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2021-08-02 11:53:56 +0100 |
commit | 24b652d3ca9818ab97907e9f2f68513632cd4693 (patch) | |
tree | ef7289d91cb7a6b161ddb320a9176ef43cd3f157 | |
parent | 02742ef957b532789c003eef80ec7f51c370e3d5 (diff) | |
download | glib-24b652d3ca9818ab97907e9f2f68513632cd4693.tar.gz |
test_string_replace: Make types agree
g_string_replace() returns guint, not gint.
Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r-- | glib/tests/string.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/glib/tests/string.c b/glib/tests/string.c index 6e22cd287..b222d6194 100644 --- a/glib/tests/string.c +++ b/glib/tests/string.c @@ -499,27 +499,27 @@ static void test_string_replace (void) { GString *s; - gint n; + guint n; s = g_string_new ("foo bar foo baz foo bar foobarbaz"); n = g_string_replace (s, "bar", "baz", 0); g_assert_cmpstr ("foo baz foo baz foo baz foobazbaz", ==, s->str); - g_assert_cmpint (n, ==, 3); + g_assert_cmpuint (n, ==, 3); n = g_string_replace (s, "baz", "bar", 3); g_assert_cmpstr ("foo bar foo bar foo bar foobazbaz", ==, s->str); - g_assert_cmpint (n, ==, 3); + g_assert_cmpuint (n, ==, 3); n = g_string_replace (s, "foobar", "bar", 1); g_assert_cmpstr ("foo bar foo bar foo bar foobazbaz", ==, s->str); - g_assert_cmpint (n, ==, 0); + g_assert_cmpuint (n, ==, 0); s = g_string_assign (s, "aaaaaaaa"); n = g_string_replace (s, "a", "abcdefghijkl", 0); g_assert_cmpstr ("abcdefghijklabcdefghijklabcdefghijklabcdefghijklabcdefghijklabcdefghijklabcdefghijklabcdefghijkl", ==, s->str); - g_assert_cmpint (n, ==, 8); + g_assert_cmpuint (n, ==, 8); g_string_free (s, TRUE); } |