Commit b7a6d28e authored by Thomas Turner's avatar Thomas Turner Committed by Michael Niedermayer

avutil/tests: improved code coverage for atomic

Signed-off-by: 's avatarThomas Turner <thomastdt@googlemail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 9b425bd2
......@@ -21,7 +21,9 @@
int main(void)
{
volatile int val = 1;
volatile int val = 1;
void *tmp1 = (int *)&val;
void * volatile *tmp2 = &tmp1;
int res;
res = avpriv_atomic_int_add_and_fetch(&val, 1);
......@@ -29,6 +31,8 @@ int main(void)
avpriv_atomic_int_set(&val, 3);
res = avpriv_atomic_int_get(&val);
av_assert0(res == 3);
avpriv_atomic_ptr_cas(tmp2, tmp1, &res);
av_assert0(*tmp2 == &res);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment