mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 00:34:59 +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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue