From cdd393deda16062c9b0fc83721eb2d323692c13b Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Sun, 9 Feb 2014 12:28:44 -0500 Subject: [PATCH] utils tests: fix sign comparison problem This test compares a guint8 and a gchar with '==' which fails when comparing 240 to -16, even though these are the same byte value. Add an explicit 'guchar' cast to correct the problem. https://bugs.freedesktop.org/show_bug.cgi?id=74754 --- tests/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/util.c b/tests/util.c index ecd83eb..e090f5c 100644 --- a/tests/util.c +++ b/tests/util.c @@ -150,7 +150,7 @@ static void test_set_bit(void) } } for (j = 0 ; j < bytes; ++j) { - g_assert(dest[j] == tests[i].dest[j]); + g_assert(dest[j] == (guchar) tests[i].dest[j]); } g_free(dest); } -- 1.8.5.3