ProteoWizard
Functions | Variables
PeakFamilyDetectorFTTest.cpp File Reference
#include "PeakFamilyDetectorFT.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
double peakFamilyDetectorFTTestData_ []
int peakFamilyDetectorFTTestDataSize_

Function Documentation

void test ( )

Definition at line 43 of file PeakFamilyDetectorFTTest.cpp.

References pwiz::analysis::PeakFamilyDetectorFT::Config::cp, pwiz::analysis::PeakFamilyDetectorFT::detect(), pwiz::analysis::PeakFamilyDetectorFT::Config::log, os_, peakFamilyDetectorFTTestData_, peakFamilyDetectorFTTestDataSize_, unit_assert, and unit_assert_equal.

{
// instantiate PeakFamilyDetectorFT
config.log = os_;
config.cp = CalibrationParameters::thermo_FT();
PeakFamilyDetectorFT detector(config);
// detect
vector<PeakFamily> result;
const MZIntensityPair* begin =
reinterpret_cast<const MZIntensityPair*>(&peakFamilyDetectorFTTestData_[0]);
detector.detect(begin, end, result);
if (os_)
{
*os_ << setprecision(10) << "result: " << result.size() << endl;
copy(result.begin(), result.end(), ostream_iterator<PeakFamily>(*os_, "\n"));
}
unit_assert(result.size() == 1);
unit_assert_equal(result[0].mzMonoisotopic, 810.4148, .005);
}
int main ( int  argc,
char *  argv[] 
)

Definition at line 72 of file PeakFamilyDetectorFTTest.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;
if (os_) *os_ << "PeakFamilyDetectorFTTest\n";
test();
}
catch (exception& e)
{
TEST_FAILED(e.what())
}
catch (...)
{
TEST_FAILED("Caught unknown exception.")
}
}

Variable Documentation

ostream* os_ = 0

Definition at line 36 of file PeakFamilyDetectorFTTest.cpp.

double peakFamilyDetectorFTTestData_[]

Referenced by test().

int peakFamilyDetectorFTTestDataSize_

Referenced by test().