ProteoWizard
Functions | Variables
ChromatogramListFactoryTest.cpp File Reference
#include "ChromatogramListFactory.hpp"
#include "pwiz/utility/misc/unit.hpp"
#include "pwiz/utility/misc/Std.hpp"
#include <cstring>

Go to the source code of this file.

Functions

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

Variables

ostream * os_ = 0
 

Function Documentation

◆ testUsage()

void testUsage ( )

Definition at line 39 of file ChromatogramListFactoryTest.cpp.

40{
41 if (os_) *os_ << "ChromatogramListFactory::usage():\n" << ChromatogramListFactory::usage() << endl;
42}
static std::string usage(bool detailedHelp=true, const char *morehelp_prompt=NULL, int maxLineLength=80)
user-friendly documentation, with option of less or more detail

References os_, and pwiz::analysis::ChromatogramListFactory::usage().

Referenced by main(), and test().

◆ testWrap()

void testWrap ( )

Definition at line 45 of file ChromatogramListFactoryTest.cpp.

46{
47 MSData msd;
49
51
52 unit_assert(sl.get());
53 unit_assert_operator_equal(2, sl->size());
54
55 // CompassXtract and pwiz data processing
57 unit_assert_operator_equal(1, msd.allDataProcessingPtrs()[1]->processingMethods.size());
58
59 // make sure we can handle config file lines copied from commandline
60 // with quotes intact
61 ChromatogramListFactory::wrap(msd, "'index [1,1]'");
62 unit_assert_operator_equal(1, sl->size());
63 unit_assert_operator_equal("sic", sl->chromatogramIdentity(0).id);
64
66 unit_assert_operator_equal(1, msd.allDataProcessingPtrs()[1]->processingMethods.size());
67}
static void wrap(msdata::MSData &msd, const std::string &wrapper, pwiz::util::IterationListenerRegistry *ilr=NULL)
instantiate the ChromatogramListWrapper indicated by wrapper
PWIZ_API_DECL void initializeTiny(MSData &msd)
boost::shared_ptr< ChromatogramList > ChromatogramListPtr
Definition MSData.hpp:785
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition MSData.hpp:850
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
Definition MSData.hpp:886
std::vector< DataProcessingPtr > allDataProcessingPtrs() const
return dataProcessingPtrs augmented by the dataProcessingPtr() set in SpectrumList and/or Chromatogra...
ChromatogramListPtr chromatogramListPtr
all chromatograms for this run.
Definition MSData.hpp:830
#define unit_assert(x)
Definition unit.hpp:85
#define unit_assert_operator_equal(expected, actual)
Definition unit.hpp:92

References pwiz::msdata::MSData::allDataProcessingPtrs(), pwiz::msdata::Run::chromatogramListPtr, pwiz::msdata::examples::initializeTiny(), pwiz::msdata::MSData::run, unit_assert, unit_assert_operator_equal, and pwiz::analysis::ChromatogramListFactory::wrap().

Referenced by test().

◆ test()

void test ( )

Definition at line 119 of file ChromatogramListFactoryTest.cpp.

120{
121 testUsage();
122 testWrap();
123 //testWrapPolarity();
124}

References testUsage(), and testWrap().

Referenced by main().

◆ main()

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

Definition at line 127 of file ChromatogramListFactoryTest.cpp.

128{
129 TEST_PROLOG(argc, argv)
130
131 try
132 {
133 if (argc>1 && !strcmp(argv[1],"-v")) os_ = &cout;
134 test();
135 }
136 catch (exception& e)
137 {
138 TEST_FAILED(e.what())
139 }
140 catch (...)
141 {
142 TEST_FAILED("Caught unknown exception.")
143 }
144
146}
#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 ChromatogramListFactoryTest.cpp.

Referenced by main(), and testUsage().