From 04941b3cb8712cee9c3b0806cfe7aa76287c40e8 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Sun, 24 Jul 2016 16:09:47 +0200 Subject: Updates to the local test suite - Adjust parameters to bring the running time of each test closer to 1 second - compression/arcode.c: array access one past - "inline" -> "static inline" - Remove cchecklink support --- test/c/fftsp.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'test/c/fftsp.c') diff --git a/test/c/fftsp.c b/test/c/fftsp.c index 3c7c23c3..f83bd41f 100644 --- a/test/c/fftsp.c +++ b/test/c/fftsp.c @@ -145,13 +145,13 @@ int dfft(float x[], float y[], int np) /* Test harness */ -float * xr, * xi; +#define NRUNS 3000 int main(int argc, char ** argv) { - int n, np, npm, n2, i, j; + int n, np, npm, n2, i, j, nruns; float enp, t, y, z, zr, zi, zm, a; - float * pxr, * pxi; + float * xr, * xi, * pxr, * pxi; if (argc >= 2) n = atoi(argv[1]); else n = 12; np = 1 << n; @@ -162,21 +162,23 @@ int main(int argc, char ** argv) xi = calloc(np, sizeof(float)); pxr = xr; pxi = xi; - *pxr = (enp - 1.0) * 0.5f; - *pxi = 0.0; - n2 = np / 2; - *(pxr+n2) = -0.5; - *(pxi+n2) = 0.0; - for (i = 1; i <= npm; i++) { - j = np - i; - *(pxr+i) = -0.5; - *(pxr+j) = -0.5; - z = t * (float)i; - y = -0.5f*(cosf(z)/sinf(z)); - *(pxi+i) = y; - *(pxi+j) = -y; + for (nruns = 0; nruns < NRUNS; nruns++) { + *pxr = (enp - 1.0) * 0.5f; + *pxi = 0.0; + n2 = np / 2; + *(pxr+n2) = -0.5; + *(pxi+n2) = 0.0; + for (i = 1; i <= npm; i++) { + j = np - i; + *(pxr+i) = -0.5; + *(pxr+j) = -0.5; + z = t * (float)i; + y = -0.5f*(cosf(z)/sinf(z)); + *(pxi+i) = y; + *(pxi+j) = -y; + } + dfft(xr,xi,np); } - dfft(xr,xi,np); zr = 0.0; zi = 0.0; npm = np-1; -- cgit