mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-14 10:36:34 +01:00
minimalistic Evoral::Curve Unit Test.
This commit is contained in:
parent
f1a59e5373
commit
2a7389d8df
3 changed files with 47 additions and 0 deletions
32
libs/evoral/test/CurveTest.cpp
Normal file
32
libs/evoral/test/CurveTest.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
#include "CurveTest.hpp"
|
||||||
|
#include "evoral/ControlList.hpp"
|
||||||
|
#include "evoral/Curve.hpp"
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
CPPUNIT_TEST_SUITE_REGISTRATION (CurveTest);
|
||||||
|
|
||||||
|
using namespace Evoral;
|
||||||
|
|
||||||
|
void
|
||||||
|
CurveTest::interpolateTest1 ()
|
||||||
|
{
|
||||||
|
float vec[1024];
|
||||||
|
|
||||||
|
Parameter param (Parameter(0));
|
||||||
|
const Evoral::ParameterDescriptor desc;
|
||||||
|
ControlList *cl (new ControlList(param, desc));
|
||||||
|
|
||||||
|
cl->create_curve();
|
||||||
|
|
||||||
|
cl->fast_simple_add(0.0 , 0.0);
|
||||||
|
cl->fast_simple_add(8191.0 , 8191.0);
|
||||||
|
|
||||||
|
cl->curve().get_vector(1024, 2047, vec, 1024);
|
||||||
|
|
||||||
|
for (int i = 0; i < 1024; ++i) {
|
||||||
|
CPPUNIT_ASSERT_EQUAL (1024.f + i, vec[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
cl->destroy_curve();
|
||||||
|
delete cl;
|
||||||
|
}
|
||||||
14
libs/evoral/test/CurveTest.hpp
Normal file
14
libs/evoral/test/CurveTest.hpp
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
#include <cppunit/TestFixture.h>
|
||||||
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
|
|
||||||
|
class CurveTest : public CppUnit::TestFixture
|
||||||
|
{
|
||||||
|
CPPUNIT_TEST_SUITE (CurveTest);
|
||||||
|
CPPUNIT_TEST (interpolateTest1);
|
||||||
|
CPPUNIT_TEST_SUITE_END ();
|
||||||
|
|
||||||
|
public:
|
||||||
|
void interpolateTest1 ();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -137,6 +137,7 @@ def build(bld):
|
||||||
test/SequenceTest.cpp
|
test/SequenceTest.cpp
|
||||||
test/SMFTest.cpp
|
test/SMFTest.cpp
|
||||||
test/RangeTest.cpp
|
test/RangeTest.cpp
|
||||||
|
test/CurveTest.cpp
|
||||||
test/testrunner.cpp
|
test/testrunner.cpp
|
||||||
'''
|
'''
|
||||||
obj.includes = ['.', './src']
|
obj.includes = ['.', './src']
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue