summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2014-02-09 12:28:44 -0500
committerMarc-André Lureau <marcandre.lureau@redhat.com>2014-02-10 14:38:57 +0100
commite189c976943f346b712dd51285a30ff8cd4e819a (patch)
tree1dae9e145ee8c1e514bf801bd4cc35a590750839 /tests
parent39555c4f69261c2297c99c75885f94c8daae7216 (diff)
downloadspice-gtk-e189c976943f346b712dd51285a30ff8cd4e819a.tar.gz
spice-gtk-e189c976943f346b712dd51285a30ff8cd4e819a.tar.xz
spice-gtk-e189c976943f346b712dd51285a30ff8cd4e819a.zip
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
Diffstat (limited to 'tests')
-rw-r--r--tests/util.c2
1 files changed, 1 insertions, 1 deletions
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);
}