Cleanup: doc/examples makefile
[urcu.git] / tests / test_uatomic.c
index 3faae661f4bb1382de593d17f26f6462b088dd33..804ce7bd8a79b1945f9fcd9ea5098d3f34a7a971 100644 (file)
 #include <urcu/uatomic.h>
 
 struct testvals {
+#ifdef UATOMIC_HAS_ATOMIC_BYTE
        unsigned char c;
+#endif
+#ifdef UATOMIC_HAS_ATOMIC_SHORT
        unsigned short s;
+#endif
        unsigned int i;
        unsigned long l;
 };
@@ -62,6 +66,10 @@ do {                                         \
        assert(uatomic_read(ptr) == 122);       \
        v = uatomic_sub_return(ptr, 1);         \
        assert(v == 121);                       \
+       uatomic_sub(ptr, (unsigned int) 2);     \
+       assert(uatomic_read(ptr) == 119);       \
+       uatomic_inc(ptr);                       \
+       uatomic_inc(ptr);                       \
        assert(uatomic_read(ptr) == 121);       \
        uatomic_and(ptr, 129);                  \
        assert(uatomic_read(ptr) == 1);         \
This page took 0.022672 seconds and 4 git commands to generate.