diff peck_test.c @ 11:abdcde012978

backup
author Peter Meerwald <p.meerwald@bct-electronic.com>
date Thu, 22 Sep 2011 15:19:18 +0200
parents 707be088ccc3
children
line wrap: on
line diff
--- a/peck_test.c	Wed Sep 21 15:20:58 2011 +0200
+++ b/peck_test.c	Thu Sep 22 15:19:18 2011 +0200
@@ -67,7 +67,7 @@
 
         if (j == 0) {
             for (i = 0; i < 8; i++)
-                printf("%d: %f\n", i, *(float*)&res[i] / N);
+                printf("%d: %f %f\n", i, ((float*)&res[i])[0] / N, ((float*)&res[i])[1] / N);
         }
     }
     peck_fftr_free(p);    
@@ -75,8 +75,12 @@
     peck_fft_cleanup();
 
     for (i = 0; i < N; i++) {
-        if (fabs(*(float*)&in[i] - *(float*)&res[i]/N) > 0.00001) {
-            fprintf(stderr, "!!!! ERROR !!!! at %d\n", i);
+        if (fabs(((float*)&in[i])[0] - ((float*)&res[i])[0]/N) > 0.00001) {
+            fprintf(stderr, "!!!! ERROR0 !!!! at %d\n", i);
+            exit(EXIT_FAILURE);
+        }
+        if (fabs(((float*)&in[i])[1] - ((float*)&res[i])[1]/N) > 0.00001) {
+            fprintf(stderr, "!!!! ERROR1 !!!! at %d\n", i);
             exit(EXIT_FAILURE);
         }
     }

Repositories maintained by Peter Meerwald, pmeerw@pmeerw.net.