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