diff options
Diffstat (limited to 'tests/test-atomic.c')
-rw-r--r-- | tests/test-atomic.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test-atomic.c b/tests/test-atomic.c index 27bf5520e..e9bd6bda0 100644 --- a/tests/test-atomic.c +++ b/tests/test-atomic.c @@ -61,6 +61,16 @@ ovs_assert(value == 8); \ } +static void +test_atomic_flag(void) +{ + atomic_flag flag = ATOMIC_FLAG_INIT; + ovs_assert(atomic_flag_test_and_set(&flag) == false); + ovs_assert(flag.b == true); + atomic_flag_clear(&flag); + ovs_assert(flag.b == false); +} + int main(void) { @@ -90,5 +100,7 @@ main(void) TEST_ATOMIC_TYPE(atomic_uint64_t, uint64_t); TEST_ATOMIC_TYPE(atomic_int64_t, int64_t); + test_atomic_flag(); + return 0; } |