[glib/glib-2-68: 2/8] test_string_replace: Make types agree




commit 3798abd5ea3b9c81f94c01e116b3c8bb7b69343a
Author: Simon McVittie <smcv collabora com>
Date:   Mon Aug 2 11:22:17 2021 +0100

    test_string_replace: Make types agree
    
    g_string_replace() returns guint, not gint.
    
    Signed-off-by: Simon McVittie <smcv collabora com>

 glib/tests/string.c | 10 +++++-----
 1 file 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);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]