avutil/atomic: use av_assert0()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
eaa5882e71
commit
b274703493
@ -105,7 +105,7 @@ void *avpriv_atomic_ptr_cas(void * volatile *ptr, void *oldval, void *newval)
|
|||||||
#endif /* !HAVE_MEMORYBARRIER && !HAVE_SYNC_VAL_COMPARE_AND_SWAP && !HAVE_MACHINE_RW_BARRIER */
|
#endif /* !HAVE_MEMORYBARRIER && !HAVE_SYNC_VAL_COMPARE_AND_SWAP && !HAVE_MACHINE_RW_BARRIER */
|
||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
#include <assert.h>
|
#include "avassert.h"
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
@ -113,10 +113,10 @@ int main(void)
|
|||||||
int res;
|
int res;
|
||||||
|
|
||||||
res = avpriv_atomic_int_add_and_fetch(&val, 1);
|
res = avpriv_atomic_int_add_and_fetch(&val, 1);
|
||||||
assert(res == 2);
|
av_assert0(res == 2);
|
||||||
avpriv_atomic_int_set(&val, 3);
|
avpriv_atomic_int_set(&val, 3);
|
||||||
res = avpriv_atomic_int_get(&val);
|
res = avpriv_atomic_int_get(&val);
|
||||||
assert(res == 3);
|
av_assert0(res == 3);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user