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

◆ test()

void test ( )

Definition at line 43 of file PeakFamilyDetectorFTTest.cpp.

44{
45 // instantiate PeakFamilyDetectorFT
46
48 config.log = os_;
50 PeakFamilyDetectorFT detector(config);
51
52 // detect
53
54 vector<PeakFamily> result;
55 const MZIntensityPair* begin =
56 reinterpret_cast<const MZIntensityPair*>(&peakFamilyDetectorFTTestData_[0]);
58
59 detector.detect(begin, end, result);
60
61 if (os_)
62 {
63 *os_ << setprecision(10) << "result: " << result.size() << endl;
64 copy(result.begin(), result.end(), ostream_iterator<PeakFamily>(*os_, "\n"));
65 }
66
67 unit_assert(result.size() == 1);
68 unit_assert_equal(result[0].mzMonoisotopic, 810.4148, .005);
69}
double peakFamilyDetectorFTTestData_[]
int peakFamilyDetectorFTTestDataSize_
ostream * os_
FT-specific implementation of PeakFamilyDetector.
static CalibrationParameters thermo_FT()
The data point type of a mass spectrum.
Definition MSData.hpp:423
#define unit_assert(x)
Definition unit.hpp:85
#define unit_assert_equal(x, y, epsilon)
Definition unit.hpp:99

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

Referenced by main().

◆ main()

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

Definition at line 72 of file PeakFamilyDetectorFTTest.cpp.

73{
74 TEST_PROLOG(argc, argv)
75
76 try
77 {
78 if (argc>1 && !strcmp(argv[1],"-v")) os_ = &cout;
79 if (os_) *os_ << "PeakFamilyDetectorFTTest\n";
80 test();
81 }
82 catch (exception& e)
83 {
84 TEST_FAILED(e.what())
85 }
86 catch (...)
87 {
88 TEST_FAILED("Caught unknown exception.")
89 }
90
92}
#define TEST_EPILOG
Definition unit.hpp:183
#define TEST_FAILED(x)
Definition unit.hpp:177
#define TEST_PROLOG(argc, argv)
Definition unit.hpp:175

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

Variable Documentation

◆ os_

ostream* os_ = 0

Definition at line 36 of file PeakFamilyDetectorFTTest.cpp.

Referenced by main(), and test().

◆ peakFamilyDetectorFTTestData_

double peakFamilyDetectorFTTestData_[]
extern

Referenced by test().

◆ peakFamilyDetectorFTTestDataSize_

int peakFamilyDetectorFTTestDataSize_
extern

Referenced by test().