From: Sjoerd Simons Date: Sun, 13 Nov 2011 16:49:57 +0000 (+0100) Subject: Fix 1bit mutex test on platforms with 32 bit aligned pointers X-Git-Tag: 2.31.2~113 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=469e1a15a0eea2cf355fba245343a3ac1c29662b;p=platform%2Fupstream%2Fglib.git Fix 1bit mutex test on platforms with 32 bit aligned pointers The 1 bit mutex tests asserts: ((gsize) ptrs) % 8, ==, 0), which fails when the platform only aligns porters to 32 bits (e.g. S390 and powerpc). I'm not sure why this assertion was placed here, but given that internally g_pointer_bit_trylock uses g_atomic_int_or internally change the assertion so it only requires the alignment to be a multiple of sizeof(int) --- diff --git a/glib/tests/1bit-mutex.c b/glib/tests/1bit-mutex.c index c1ec41c..8811cd3 100644 --- a/glib/tests/1bit-mutex.c +++ b/glib/tests/1bit-mutex.c @@ -61,7 +61,7 @@ acquire (int nr, self = g_thread_self (); - g_assert_cmpint (((gsize) ptrs) % 8, ==, 0); + g_assert_cmpint (((gsize) ptrs) % sizeof(gint), ==, 0); if (!(use_pointers ? g_pointer_bit_trylock (&ptrs[nr], bits[nr])