Skip to content

Commit

Permalink
Interpolator: adding tests of the None option. see issue #71
Browse files Browse the repository at this point in the history
  • Loading branch information
nwolek committed Dec 30, 2015
1 parent 6bb5f95 commit 6e6a00e
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions test/Interpolator/Interpolator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,35 @@ class InterpolatorTest {
InterpolatorTest(Jamoma::UnitTest<InterpolatorTest>* test)
: mTest(test)
{
testLinear();
testNone();
testLinear();
testCosine();
testCubic();
testHermite();
testSpline();
}
}

void testNone() {
Jamoma::Interpolator::None<Jamoma::Sample> my_interp;

auto x0 = -1.0;
auto x1 = 2.0;
auto x2 = 1.0;
auto x3 = 4.0;

auto out = my_interp(x0);

mTest->TEST_ASSERT("testNone with 1 sample produced correct output", out == x0);

auto out2 = my_interp(x0,x1,0.25);

mTest->TEST_ASSERT("testNone with 2 samples produced correct output", out2 == x0);

auto out3 = my_interp(x0,x1,x2,x3,0.25);

mTest->TEST_ASSERT("testNone with 4 samples produced correct output", out3 == x0);

}


void testLinear() {
Expand Down

0 comments on commit 6e6a00e

Please sign in to comment.