ardour
interpolation_test.h
Go to the documentation of this file.
1 /* Copyright(C) 2000-2008 Paul Davis
2  * Author: Hans Baier
3  *
4  * Evoral is free software; you can redistribute it and/or modify it under the
5  * terms of the GNU General Public License as published by the Free Software
6  * Foundation; either version 2 of the License, or(at your option) any later
7  * version.
8  *
9  * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY
10  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program; if not, write to the Free Software Foundation, Inc.,
15  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16  */
17 
18 #include <cassert>
19 #include <stdint.h>
20 #include <cppunit/TestFixture.h>
21 #include <cppunit/extensions/HelperMacros.h>
22 
23 #include "ardour/interpolation.h"
24 
25 class InterpolationTest : public CppUnit::TestFixture
26 {
31 
32 #define NUM_SAMPLES 1000000
33 #define INTERVAL 100
34 
37 
40 
41  public:
42 
43  void setUp() {
44  for (int i = 0; i < NUM_SAMPLES; ++i) {
45  if (i % INTERVAL == 0) {
46  input[i] = 1.0f;
47  } else {
48  input[i] = 0.0f;
49  }
50  output[i] = 0.0f;
51  }
52  linear.add_channel_to (NUM_SAMPLES, NUM_SAMPLES);
53  cubic.add_channel_to (NUM_SAMPLES, NUM_SAMPLES);
54  }
55 
56  void tearDown() {
57  }
58 
61 };
CPPUNIT_TEST_SUITE(InterpolationTest)
ARDOUR::Sample input[NUM_SAMPLES]
ARDOUR::CubicInterpolation cubic
#define INTERVAL
ARDOUR::LinearInterpolation linear
void add_channel_to(int, int)
Definition: interpolation.h:51
float Sample
Definition: types.h:54
#define NUM_SAMPLES
CPPUNIT_TEST(cubicInterpolationTest)
ARDOUR::Sample output[NUM_SAMPLES]