You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avutil/tests: improved code coverage for atomic
Signed-off-by: Thomas Turner <thomastdt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
Michael Niedermayer
parent
9b425bd24c
commit
b7a6d28e5e
@@ -22,6 +22,8 @@
|
|||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
volatile int val = 1;
|
volatile int val = 1;
|
||||||
|
void *tmp1 = (int *)&val;
|
||||||
|
void * volatile *tmp2 = &tmp1;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
res = avpriv_atomic_int_add_and_fetch(&val, 1);
|
res = avpriv_atomic_int_add_and_fetch(&val, 1);
|
||||||
@@ -29,6 +31,8 @@ int main(void)
|
|||||||
avpriv_atomic_int_set(&val, 3);
|
avpriv_atomic_int_set(&val, 3);
|
||||||
res = avpriv_atomic_int_get(&val);
|
res = avpriv_atomic_int_get(&val);
|
||||||
av_assert0(res == 3);
|
av_assert0(res == 3);
|
||||||
|
avpriv_atomic_ptr_cas(tmp2, tmp1, &res);
|
||||||
|
av_assert0(*tmp2 == &res);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user