1 /* Copyright(C) 2000-2008 Paul Davis
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
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.
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
20 #include <cppunit/TestFixture.h>
21 #include <cppunit/extensions/HelperMacros.h>
23 #include "ardour/interpolation.h"
25 class InterpolationTest : public CppUnit::TestFixture
27 CPPUNIT_TEST_SUITE(InterpolationTest);
28 CPPUNIT_TEST(cubicInterpolationTest);
29 CPPUNIT_TEST(linearInterpolationTest);
30 CPPUNIT_TEST_SUITE_END();
32 #define NUM_SAMPLES 1000000
35 ARDOUR::Sample input[NUM_SAMPLES];
36 ARDOUR::Sample output[NUM_SAMPLES];
38 ARDOUR::LinearInterpolation linear;
39 ARDOUR::CubicInterpolation cubic;
44 for (int i = 0; i < NUM_SAMPLES; ++i) {
45 if (i % INTERVAL == 0) {
52 linear.add_channel_to (NUM_SAMPLES, NUM_SAMPLES);
53 cubic.add_channel_to (NUM_SAMPLES, NUM_SAMPLES);
59 void linearInterpolationTest();
60 void cubicInterpolationTest();