aboutsummaryrefslogtreecommitdiff
path: root/csu
diff options
context:
space:
mode:
Diffstat (limited to 'csu')
-rw-r--r--csu/tst-atomic.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/csu/tst-atomic.c b/csu/tst-atomic.c
index 727229e..292f6e7 100644
--- a/csu/tst-atomic.c
+++ b/csu/tst-atomic.c
@@ -99,7 +99,7 @@ do_test (void)
}
mem = 0;
- if (! atomic_increment_and_test (&mem)
+ if (atomic_increment_and_test (&mem)
|| mem != 1)
{
puts ("atomic_increment_and_test test 1 failed");
@@ -114,6 +114,14 @@ do_test (void)
ret = 1;
}
+ mem = -1;
+ if (! atomic_increment_and_test (&mem)
+ || mem != 0)
+ {
+ puts ("atomic_increment_and_test test 3 failed");
+ ret = 1;
+ }
+
mem = 17;
atomic_decrement (&mem);
if (mem != 16)
@@ -123,7 +131,7 @@ do_test (void)
}
mem = 0;
- if (! atomic_decrement_and_test (&mem)
+ if (atomic_decrement_and_test (&mem)
|| mem != -1)
{
puts ("atomic_decrement_and_test test 1 failed");
@@ -139,6 +147,14 @@ do_test (void)
}
mem = 1;
+ if (! atomic_decrement_and_test (&mem)
+ || mem != 0)
+ {
+ puts ("atomic_decrement_and_test test 1 failed");
+ ret = 1;
+ }
+
+ mem = 1;
if (atomic_decrement_if_positive (&mem) != 1
|| mem != 0)
{