From d3146363d06a1e60abea505bbcc718b72911f884 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Thu, 3 Jun 2010 01:08:55 +0200 Subject: [PATCH] test-mathutils.c: added tests for next_power_of_two --- tests/src/test-mathutils.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/src/test-mathutils.c 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; +} + -- 2.26.2