Jamoma API  0.6.0.a19
TTInterpolate.test.cpp File Reference

TTInterpolateTest is an class used for unit tests of the interpolation algorithms in #TTInterpolate.h. More...

+ Include dependency graph for TTInterpolate.test.cpp:

Go to the source code of this file.

Functions

TTFloat64 InterpolateAndTestLinear (const TTFloat64 x0, const TTFloat64 x1, const TTFloat64 &aDelta, TTFloat64 anExpectedValue)
 Perform one linear interpolation and compare the outcome to expected value. More...
 
void TestLinear (int &anErrorCount, int &aTestAssertionCount)
 Test for correct linear interpolations performance. More...
 
TTFloat64 InterpolateAndTestCosine (const TTFloat64 x0, const TTFloat64 x1, const TTFloat64 &aDelta, TTFloat64 anExpectedValue)
 Perform one cosine interpolation and compare the outcome to expected value. More...
 
void TestCosine (int &anErrorCount, int &aTestAssertionCount)
 Test for correct cosine interpolations performance. More...
 
TTFloat64 InterpolateAndTestCubic (const TTFloat64 x0, const TTFloat64 x1, const TTFloat64 x2, const TTFloat64 x3, const TTFloat64 &aDelta, TTFloat64 anExpectedValue)
 Perform one cubic interpolation and compare the outcome to expected value. More...
 
void TestCubic (int &anErrorCount, int &aTestAssertionCount)
 Test for correct cubic interpolations performance. More...
 

Variables

 TT_OBJECT_CONSTRUCTOR {
 Constructor macro.
 

Detailed Description

TTInterpolateTest is an class used for unit tests of the interpolation algorithms in #TTInterpolate.h.

Author
Trond Lossius

Definition in file TTInterpolate.test.cpp.

Function Documentation

TTFloat64 InterpolateAndTestCosine ( const TTFloat64  x0,
const TTFloat64  x1,
const TTFloat64 aDelta,
TTFloat64  anExpectedValue 
)

Perform one cosine interpolation and compare the outcome to expected value.

Parameters
x0Sample value at prior integer index
x1Sample value at next integer index
aDeltaThe fractional value for which we want to perform the interpolation. aDelta=0 => x0
aDelta=1 => x1
expectedValueThe expected outcome of the interpolation
Returns
TRUE if the interpolat returnes the expected value, else FALSE

Definition at line 97 of file TTInterpolate.test.cpp.

References TTInterpolateCosine().

Referenced by TestCosine().

+ Here is the call graph for this function:

TTFloat64 InterpolateAndTestCubic ( const TTFloat64  x0,
const TTFloat64  x1,
const TTFloat64  x2,
const TTFloat64  x3,
const TTFloat64 aDelta,
TTFloat64  anExpectedValue 
)

Perform one cubic interpolation and compare the outcome to expected value.

Parameters
x0Sample value at integer index prior to x0
x1Sample value at prior integer index
x2Sample value at next integer index
x3Sample value at integer index after y
aDeltaFractional location between x1 (0) and x2 (1)
deltaThe fractional value for which we want to perform the interpolation. aDelta=0 => x0
aDelta=1 => x1
expectedValueThe expected outcome of the interpolation
Returns
TRUE if the interpolat returnes the expected value, else FALSE

Definition at line 146 of file TTInterpolate.test.cpp.

References TTInterpolateCubic().

Referenced by TestCubic().

+ Here is the call graph for this function:

TTFloat64 InterpolateAndTestLinear ( const TTFloat64  x0,
const TTFloat64  x1,
const TTFloat64 aDelta,
TTFloat64  anExpectedValue 
)

Perform one linear interpolation and compare the outcome to expected value.

Parameters
x0Sample value at prior integer index
x1Sample value at next integer index
deltaThe fractional value for which we want to perform the interpolation. delta=0 => x0
delta=1 => x1
expectedValueThe expected outcome of the interpolation
Returns
TRUE if the interpolat returnes the expected value, else FALSE

Definition at line 50 of file TTInterpolate.test.cpp.

References TTInterpolateLinear().

Referenced by TestLinear().

+ Here is the call graph for this function:

void TestCosine ( int &  anErrorCount,
int &  aTestAssertionCount 
)

Test for correct cosine interpolations performance.

Parameters
anErrorCountThe number of asserts that failed
aTestAssertionCountThe numebr of asserts carried out

Definition at line 111 of file TTInterpolate.test.cpp.

References InterpolateAndTestCosine().

+ Here is the call graph for this function:

void TestCubic ( int &  anErrorCount,
int &  aTestAssertionCount 
)

Test for correct cubic interpolations performance.

Parameters
anErrorCountThe number of asserts that failed
aTestAssertionCountThe numebr of asserts carried out

Definition at line 160 of file TTInterpolate.test.cpp.

References InterpolateAndTestCubic().

+ Here is the call graph for this function:

void TestLinear ( int &  anErrorCount,
int &  aTestAssertionCount 
)

Test for correct linear interpolations performance.

Parameters
anErrorCountThe number of asserts that failed
aTestAssertionCountThe numebr of asserts carried out

Definition at line 65 of file TTInterpolate.test.cpp.

References InterpolateAndTestLinear().

+ Here is the call graph for this function: