X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Ftest_atomic.c;h=3d2b64e434d3ef97eb0feec03a2c49968b96bc2e;hp=bf847572815012be866ff9b921c85b97ace1aa0d;hb=6edb297e0e3be79bdf91f841879d3358454a6601;hpb=2c5e5fb3c4f567af1816aaada4cfbc69a0c1a882 diff --git a/tests/test_atomic.c b/tests/test_atomic.c index bf84757..3d2b64e 100644 --- a/tests/test_atomic.c +++ b/tests/test_atomic.c @@ -13,20 +13,20 @@ static struct testvals vals; #define do_test(ptr) \ do { \ - __typeof__(*ptr) v; \ + __typeof__(*(ptr)) v; \ \ atomic_add(ptr, 10); \ - assert(*ptr == 10); \ - atomic_add(ptr, -11); \ - assert(*ptr == (__typeof__(*ptr))-1U); \ - v = cmpxchg(ptr, -1, 22); \ - assert(*ptr == 22); \ - assert(v == (__typeof__(*ptr))-1U); \ + assert(*(ptr) == 10); \ + atomic_add(ptr, -11UL); \ + assert(*(ptr) == (__typeof__(*(ptr)))-1UL); \ + v = cmpxchg(ptr, -1UL, 22); \ + assert(*(ptr) == 22); \ + assert(v == (__typeof__(*(ptr)))-1UL); \ v = cmpxchg(ptr, 33, 44); \ - assert(*ptr == 22); \ + assert(*(ptr) == 22); \ assert(v == 22); \ v = xchg(ptr, 55); \ - assert(*ptr == 55); \ + assert(*(ptr) == 55); \ assert(v == 22); \ } while (0)