diff options
author | Thomas Turner <thomastdt@googlemail.com> | 2016-12-31 20:42:40 -0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-01-01 16:57:55 +0100 |
commit | b7a6d28e5e7ae4dff7c53a2f24e2017220dd6cc1 (patch) | |
tree | b6238d28bb5d55c40ce5d28bfb2bca579055ba61 /libavutil | |
parent | 9b425bd24c48085b0d96bc0698af82bd46e57d03 (diff) | |
download | ffmpeg-streaming-b7a6d28e5e7ae4dff7c53a2f24e2017220dd6cc1.zip ffmpeg-streaming-b7a6d28e5e7ae4dff7c53a2f24e2017220dd6cc1.tar.gz |
avutil/tests: improved code coverage for atomic
Signed-off-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/tests/atomic.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavutil/tests/atomic.c b/libavutil/tests/atomic.c index c92f220..e41bf5a 100644 --- a/libavutil/tests/atomic.c +++ b/libavutil/tests/atomic.c @@ -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; } |