From: Paul Brossier Date: Wed, 2 Jun 2010 23:08:55 +0000 (+0200) Subject: test-mathutils.c: added tests for next_power_of_two X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d3146363d06a1e60abea505bbcc718b72911f884;p=aubio.git test-mathutils.c: added tests for next_power_of_two --- diff --git a/tests/src/test-mathutils.c b/tests/src/test-mathutils.c new file mode 100644 index 00000000..bb3756cc --- /dev/null +++ b/tests/src/test-mathutils.c @@ -0,0 +1,22 @@ +#include +#include +#include + +int main(){ + int a, b; + + a = 31; b = aubio_next_power_of_two(a); + fprintf(stdout, "next_power_of_two of %d is %d\n", a, b); + assert(b == 32); + + a = 32; b = aubio_next_power_of_two(a); + fprintf(stdout, "next_power_of_two of %d is %d\n", a, b); + assert(b == 32); + + a = 33; b = aubio_next_power_of_two(a); + fprintf(stdout, "next_power_of_two of %d is %d\n", a, b); + assert(b == 64); + + return 0; +} +