13
0
livetrax/libs/evoral/test/CurveTest.hpp
Colin Fletcher cb3961d953 Add a test for the constrained cubic interpolation of Evoral::Curve
Add a test, based on the worked example in www.korf.co.uk/spline.pdf, for
the constrained cubic spline interpolation.

The delta values for the float comparisons are rather arbitrary, I'm sorry
to say: they're basically chosen so that everything passes.
2015-02-13 12:25:51 +00:00

30 lines
811 B
C++

#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <boost/shared_ptr.hpp>
#include "evoral/ControlList.hpp"
class CurveTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE (CurveTest);
CPPUNIT_TEST (twoPointLinear);
CPPUNIT_TEST (threePointLinear);
CPPUNIT_TEST (threePointDiscete);
CPPUNIT_TEST (constrainedCubic);
CPPUNIT_TEST (ctrlListEval);
CPPUNIT_TEST_SUITE_END ();
public:
void twoPointLinear ();
void threePointLinear ();
void threePointDiscete ();
void constrainedCubic ();
void ctrlListEval ();
private:
boost::shared_ptr<Evoral::ControlList> TestCtrlList() {
Evoral::Parameter param (Evoral::Parameter(0));
const Evoral::ParameterDescriptor desc;
return boost::shared_ptr<Evoral::ControlList> (new Evoral::ControlList(param, desc));
}
};