From bf6a4e01b6f1281a4711f293ef0a415c209ff13b Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca> Date: Fri, 5 Aug 2011 10:47:41 -0400 Subject: [PATCH] Re-enables test cases, including the rotation test --- Makefile.am | 2 ++ configure.ac | 2 +- libcelt/Makefile.am | 56 +++++++++++------------------------ libcelt/tests/Makefile.am | 17 ----------- libcelt/tests/mathops-test.c | 2 +- libcelt/tests/rotation-test.c | 1 - 6 files changed, 21 insertions(+), 59 deletions(-) delete mode 100644 libcelt/tests/Makefile.am diff --git a/Makefile.am b/Makefile.am index 791b19802..cacb74f81 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,6 +2,8 @@ AUTOMAKE_OPTIONS = subdir-objects lib_LTLIBRARIES = libopus.la +SUBDIRS = . libcelt + INCLUDES = -I$(top_srcdir)/libcelt -I$(top_srcdir)/silk -I$(top_srcdir)/silk/float -I$(top_srcdir)/silk/fixed include celt_sources.mk diff --git a/configure.ac b/configure.ac index 8da18e6c0..9b10e8a3a 100644 --- a/configure.ac +++ b/configure.ac @@ -200,7 +200,7 @@ fi AM_CONDITIONAL([FIXED_POINT], [test x$ac_enable_fixed = xyes]) -AC_OUTPUT([Makefile]) +AC_OUTPUT([Makefile libcelt/Makefile]) AC_MSG_RESULT([ ------------------------------------------------------------------------ diff --git a/libcelt/Makefile.am b/libcelt/Makefile.am index 2f1ac73be..0d1df1e27 100644 --- a/libcelt/Makefile.am +++ b/libcelt/Makefile.am @@ -1,39 +1,17 @@ -# Disable automatic dependency tracking if using other tools than gcc and gmake -#AUTOMAKE_OPTIONS = no-dependencies - - -pkginclude_HEADERS = celt.h celt_types.h celt_header.h -EXTRA_DIST= match-test.sh libcelt.vcxproj libcelt.vcxproj.filters - -#INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) @OGG_CFLAGS@ - -TESTS = match-test.sh - -noinst_SCRIPTS = match-test.sh - -lib_LTLIBRARIES = libcelt@LIBCELT_SUFFIX@.la - -# Sources for compilation in the library -libcelt@LIBCELT_SUFFIX@_la_SOURCES = bands.c celt.c cwrs.c ecintrin.h entcode.c \ - entdec.c entenc.c header.c kiss_fft.c laplace.c mathops.c mdct.c \ - modes.c pitch.c plc.c quant_bands.c rate.c vq.c - -libcelt@LIBCELT_SUFFIX@_la_LDFLAGS = \ - -version-info @CELT_LT_CURRENT@:@CELT_LT_REVISION@:@CELT_LT_AGE@ \ - -no-undefined - -noinst_HEADERS = _kiss_fft_guts.h arch.h bands.h fixed_c5x.h fixed_c6x.h \ - cwrs.h ecintrin.h entcode.h entdec.h entenc.h fixed_generic.h float_cast.h \ - kiss_fft.h laplace.h mdct.h mfrngcod.h \ - mathops.h modes.h os_support.h pitch.h \ - quant_bands.h rate.h stack_alloc.h \ - static_modes_fixed.h static_modes_float.h vq.h plc.h - -noinst_PROGRAMS = testcelt dump_modes -testcelt_SOURCES = testcelt.c -testcelt_LDADD = libcelt@LIBCELT_SUFFIX@.la -INCLUDES = -#libcelt@LIBCELT_SUFFIX@_la_LIBADD = - -dump_modes_SOURCES = dump_modes.c -dump_modes_LDADD = libcelt@LIBCELT_SUFFIX@.la +INCLUDES = -I$(top_srcdir)/libcelt +METASOURCES = AUTO + +TESTS = type-test ectest cwrs32-test dft-test laplace-test mdct-test mathops-test rotation-test tandem-test + +noinst_PROGRAMS = type-test ectest cwrs32-test dft-test laplace-test mdct-test mathops-test rotation-test tandem-test + +type_test_SOURCES = tests/type-test.c +ectest_SOURCES = tests/ectest.c +cwrs32_test_SOURCES = tests/cwrs32-test.c +dft_test_SOURCES = tests/dft-test.c +laplace_test_SOURCES = tests/laplace-test.c +mdct_test_SOURCES = tests/mdct-test.c +rotation_test_SOURCES = tests/rotation-test.c +mathops_test_SOURCES = tests/mathops-test.c +tandem_test_SOURCES = tests/tandem-test.c +tandem_test_LDADD = $(top_builddir)/libopus.la diff --git a/libcelt/tests/Makefile.am b/libcelt/tests/Makefile.am deleted file mode 100644 index 5a7b508c7..000000000 --- a/libcelt/tests/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -INCLUDES = -I$(top_srcdir)/libcelt -METASOURCES = AUTO - -TESTS = type-test ectest cwrs32-test dft-test laplace-test mdct-test mathops-test tandem-test - -noinst_PROGRAMS = type-test ectest cwrs32-test dft-test laplace-test mdct-test mathops-test tandem-test - -type_test_SOURCES = type-test.c -ectest_SOURCES = ectest.c -cwrs32_test_SOURCES = cwrs32-test.c -dft_test_SOURCES = dft-test.c -laplace_test_SOURCES = laplace-test.c -mdct_test_SOURCES = mdct-test.c -#rotation_test_SOURCES = rotation-test.c -mathops_test_SOURCES = mathops-test.c -tandem_test_SOURCES = tandem-test.c -tandem_test_LDADD = $(top_builddir)/libcelt/libcelt@LIBCELT_SUFFIX@.la diff --git a/libcelt/tests/mathops-test.c b/libcelt/tests/mathops-test.c index 9eb75d929..efe805370 100644 --- a/libcelt/tests/mathops-test.c +++ b/libcelt/tests/mathops-test.c @@ -134,7 +134,7 @@ void testexp2log2(void) opus_val32 x; for (x=8;x<65536;x+=(x>>3)) { - float error = fabs(x-0.25*celt_exp2(celt_log2(x)<<1))/16384; + float error = fabs(x-0.25*celt_exp2(celt_log2(x)))/16384; if (error>0.004) { fprintf (stderr, "celt_log2/celt_exp2 failed: fabs(x-(celt_exp2(celt_log2(x))))>0.001 (x = %ld, error = %f)\n", (long)x,error); diff --git a/libcelt/tests/rotation-test.c b/libcelt/tests/rotation-test.c index 1b9ee9fc9..054056842 100644 --- a/libcelt/tests/rotation-test.c +++ b/libcelt/tests/rotation-test.c @@ -23,7 +23,6 @@ void test_rotation(int N, int K) double err = 0, ener = 0, snr, snr0; opus_val16 x0[MAX_SIZE]; opus_val16 x1[MAX_SIZE]; - int nb_rotations = (N+4*K)/(8*K); for (i=0;i<N;i++) x1[i] = x0[i] = rand()%32767-16384; exp_rotation(x1, N, 1, 1, K, SPREAD_NORMAL); -- GitLab