History

Add new test tests/downsample_test.c and hook into build.

Erik de Castro Lopo committed 18 years ago

Commit a2236761 parent 6328b632 files · +62 −1Browse files

Unified · Split

2 files
  1. tests/Makefile.am +5 −1
  2. tests/downsample_test.c +57 −0
tests/Makefile.am+5−1
@@ -1,7 +1,7 @@
1noinst_PROGRAMS = misc_test termination_test simple_test callback_test \1noinst_PROGRAMS = misc_test termination_test simple_test callback_test \
2 reset_test multi_channel_test snr_bw_test \2 reset_test multi_channel_test snr_bw_test \
3 float_short_test varispeed_test callback_hang_test \3 float_short_test varispeed_test callback_hang_test \
4 src-evaluate throughput_test4 src-evaluate throughput_test downsample_test
5 5
6SAMPLRATEDIR =../src6SAMPLRATEDIR =../src
7INCLUDES = -I$(srcdir)/$(SAMPLRATEDIR)7INCLUDES = -I$(srcdir)/$(SAMPLRATEDIR)
@@ -39,6 +39,9 @@ callback_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la · 31 unmodified lines
39float_short_test_SOURCES = float_short_test.c util.c util.h39float_short_test_SOURCES = float_short_test.c util.c util.h
40float_short_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la40float_short_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la
41 41
42downsample_test_SOURCES = downsample_test.c util.c util.h
43downsample_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la
44
42varispeed_test_SOURCES = varispeed_test.c util.c util.h calc_snr.c45varispeed_test_SOURCES = varispeed_test.c util.c util.h calc_snr.c
43varispeed_test_CFLAGS = @FFTW3_CFLAGS@46varispeed_test_CFLAGS = @FFTW3_CFLAGS@
44varispeed_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la $(FFTW3_LIBS)47varispeed_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la $(FFTW3_LIBS)
@@ -61,6 +64,7 @@ check: $(noinst_PROGRAMS) · 16 unmodified lines
61 ./misc_test64 ./misc_test
62 ./termination_test65 ./termination_test
63 ./callback_hang_test66 ./callback_hang_test
67 ./downsample_test
64 ./simple_test68 ./simple_test
65 ./callback_test69 ./callback_test
66 ./reset_test70 ./reset_test
tests/downsample_test.c+57−0
@@ -0,0 +1,57 @@
1/*
2** Copyright (C) 2008 Erik de Castro Lopo <erikd@mega-nerd.com>
3**
4** This program is free software; you can redistribute it and/or modify
5** it under the terms of the GNU General Public License as published by
6** the Free Software Foundation; either version 2 of the License, or
7** (at your option) any later version.
8**
9** This program is distributed in the hope that it will be useful,
10** but WITHOUT ANY WARRANTY; without even the implied warranty of
11** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12** GNU General Public License for more details.
13**
14** You should have received a copy of the GNU General Public License
15** along with this program; if not, write to the Free Software
16** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
17*/
18
19#include <stdio.h>
20#include <samplerate.h>
21
22#include "util.h"
23
24static void
25downsample_test (int converter)
26{ static float in [1000], out[10] ;
27 SRC_DATA data ;
28
29 printf (" downsample_test (%-28s) ....... ", src_get_name (converter)) ;
30 fflush (stdout) ;
31
32 data.src_ratio = 1.0 / 255.0 ;
33 data.input_frames = ARRAY_LEN (in) ;
34 data.output_frames = ARRAY_LEN (out) ;
35 data.data_in = in ;
36 data.data_out = out ;
37
38 src_simple (&data, converter, 1) ;
39
40 puts ("ok") ;
41} /* downsample_test */
42
43int
44main (void)
45{
46 puts ("") ;
47
48 downsample_test (SRC_ZERO_ORDER_HOLD) ;
49 downsample_test (SRC_LINEAR) ;
50 downsample_test (SRC_SINC_FASTEST) ;
51 downsample_test (SRC_SINC_MEDIUM_QUALITY) ;
52 downsample_test (SRC_SINC_BEST_QUALITY) ;
53
54 puts ("") ;
55
56 return 0 ;
57} /* main */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t