shithub: opus

Download patch

ref: 4d108fc37a37e9f851340ada51ff301cf2b5a315
parent: 61832f162fea8d5a3d52524533429182b1127f2b
author: Jean-Marc Valin <[email protected]>
date: Tue Dec 23 04:31:39 EST 2008

Unit tests now #include the relevant source files to prevent symbol visibility
problems when building shared libraries only.

--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -14,6 +14,3 @@
 mdct_test_SOURCES = mdct-test.c
 #rotation_test_SOURCES = rotation-test.c
 mathops_test_SOURCES = mathops-test.c
-
-AM_LDFLAGS = -static
-LDADD = $(top_builddir)/libcelt/libcelt.la
--- a/tests/cwrs32-test.c
+++ b/tests/cwrs32-test.c
@@ -5,6 +5,14 @@
 #include <stdio.h>
 #include "cwrs.h"
 #include <string.h>
+
+#include "../libcelt/cwrs.c"
+#include "../libcelt/rangeenc.c"
+#include "../libcelt/rangedec.c"
+#include "../libcelt/entenc.c"
+#include "../libcelt/entdec.c"
+#include "../libcelt/entcode.c"
+
 #define NMAX (10)
 #define MMAX (9)
 
--- a/tests/dft-test.c
+++ b/tests/dft-test.c
@@ -5,6 +5,9 @@
 #include <stdio.h>
 #include "kiss_fft.h"
 
+#include "../libcelt/kiss_fft.c"
+
+
 #ifndef M_PI
 #define M_PI 3.141592653
 #endif
--- a/tests/ectest.c
+++ b/tests/ectest.c
@@ -9,6 +9,12 @@
 #include "entenc.h"
 #include "entdec.h"
 
+#include "../libcelt/rangeenc.c"
+#include "../libcelt/rangedec.c"
+#include "../libcelt/entenc.c"
+#include "../libcelt/entdec.c"
+#include "../libcelt/entcode.c"
+
 #ifndef M_LOG2E
 # define M_LOG2E    1.4426950408889634074
 #endif
--- a/tests/laplace-test.c
+++ b/tests/laplace-test.c
@@ -7,6 +7,14 @@
 #include "laplace.h"
 #include "stack_alloc.h"
 
+#include "../libcelt/rangeenc.c"
+#include "../libcelt/rangedec.c"
+#include "../libcelt/entenc.c"
+#include "../libcelt/entdec.c"
+#include "../libcelt/entcode.c"
+#include "../libcelt/laplace.c"
+
+
 int main(void)
 {
    int i;
--- a/tests/mdct-test.c
+++ b/tests/mdct-test.c
@@ -6,6 +6,9 @@
 #include "mdct.h"
 #include "stack_alloc.h"
 
+#include "../libcelt/kiss_fft.c"
+#include "../libcelt/mdct.c"
+
 #ifndef M_PI
 #define M_PI 3.141592653
 #endif
--- a/tests/real-fft-test.c
+++ b/tests/real-fft-test.c
@@ -7,6 +7,9 @@
 #include <stdio.h>
 #include <string.h>
 
+#include "../libcelt/kiss_fft.c"
+#include "../libcelt/kiss_fftr.c"
+
 int ret=0;
 
 static