Commit 50965e06 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec: add mathops test

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent eb0c08bc
......@@ -883,6 +883,7 @@ SKIPHEADERS-$(CONFIG_VDA) += vda.h vda_internal.h
SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h vdpau_internal.h
TESTPROGS = imgconvert \
mathops \
options \
avfft \
......
#include "mathops.h"
#ifdef TEST
#include <stdlib.h>
int main(void)
{
unsigned u;
for(u=0; u<65536; u++) {
unsigned s = u*u;
unsigned root = ff_sqrt(s);
unsigned root_m1 = ff_sqrt(s-1);
if (s && root != u) {
fprintf(stderr, "ff_sqrt failed at %u with %u\n", s, root);
return 1;
}
if (u && root_m1 != u - 1) {
fprintf(stderr, "ff_sqrt failed at %u with %u\n", s, root);
return 1;
}
}
return 0;
}
#endif /* TEST */
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