ProteoWizard
Functions | Variables
SavitzkyGolaySmootherTest.cpp File Reference
#include "SavitzkyGolaySmoother.hpp"
#include "pwiz/utility/misc/unit.hpp"
#include "pwiz/utility/misc/Std.hpp"

Go to the source code of this file.

Functions

void test ()
int main (int argc, char *argv[])

Variables

ostream * os_ = 0
const double testArray []

Function Documentation

void test ( )

Definition at line 44 of file SavitzkyGolaySmootherTest.cpp.

References os_, testArray, testData, and unit_assert.

{
vector<double> testData(testArray, testArray+(14*4));
if (os_)
{
*os_ << "Unsmoothed data (" << testData.size() << "):\t";
copy(testData.begin(), testData.end(), ostream_iterator<double>(*os_, "\t"));
*os_ << endl;
}
if (os_)
{
*os_ << "Smoothed data (" << smoothData.size() << "):\t";
copy(smoothData.begin(), smoothData.end(), ostream_iterator<double>(*os_, "\t"));
*os_ << endl;
}
unit_assert(smoothData.size() == testData.size());
}
int main ( int  argc,
char *  argv[] 
)

Definition at line 67 of file SavitzkyGolaySmootherTest.cpp.

References e(), os_, test(), TEST_EPILOG, TEST_FAILED, and TEST_PROLOG.

{
TEST_PROLOG(argc, argv)
try
{
if (argc>1 && !strcmp(argv[1],"-v")) os_ = &cout;
test();
}
catch (exception& e)
{
TEST_FAILED(e.what())
}
catch (...)
{
TEST_FAILED("Caught unknown exception.")
}
}

Variable Documentation

ostream* os_ = 0

Definition at line 32 of file SavitzkyGolaySmootherTest.cpp.

const double testArray[]
Initial value:
{
1, 15, 29, 20, 10, 40, 1, 50, 3, 40, 3, 25, 23, 90,
1, 15, 29, 20, 10, 40, 1, 50, 3, 40, 3, 25, 23, 90,
1, 15, 29, 20, 10, 40, 1, 50, 3, 40, 3, 25, 23, 90,
1, 15, 29, 20, 10, 40, 1, 50, 3, 40, 3, 25, 23, 90
}

Definition at line 35 of file SavitzkyGolaySmootherTest.cpp.

Referenced by test().