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 }

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

Referenced by 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 }

References pwiz::msdata::MSData::allDataProcessingPtrs(), pwiz::msdata::Run::chromatogramListPtr, pwiz::identdata::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 }

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().

os_
ostream * os_
Definition: ChromatogramListFactoryTest.cpp:36
testUsage
void testUsage()
Definition: ChromatogramListFactoryTest.cpp:39
pwiz::msdata::MSData::run
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
Definition: MSData.hpp:886
unit_assert_operator_equal
#define unit_assert_operator_equal(expected, actual)
Definition: unit.hpp:92
pwiz::msdata::ChromatogramListPtr
boost::shared_ptr< ChromatogramList > ChromatogramListPtr
Definition: MSData.hpp:785
TEST_EPILOG
#define TEST_EPILOG
Definition: unit.hpp:183
testWrap
void testWrap()
Definition: ChromatogramListFactoryTest.cpp:45
pwiz::identdata::examples::initializeTiny
PWIZ_API_DECL void initializeTiny(IdentData &mzid)
TEST_FAILED
#define TEST_FAILED(x)
Definition: unit.hpp:177
TEST_PROLOG
#define TEST_PROLOG(argc, argv)
Definition: unit.hpp:175
pwiz::msdata::MSData::allDataProcessingPtrs
std::vector< DataProcessingPtr > allDataProcessingPtrs() const
return dataProcessingPtrs augmented by the dataProcessingPtr() set in SpectrumList and/or Chromatogra...
pwiz::msdata::MSData
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:849
unit_assert
#define unit_assert(x)
Definition: unit.hpp:85
test
void test()
Definition: ChromatogramListFactoryTest.cpp:119
pwiz::msdata::Run::chromatogramListPtr
ChromatogramListPtr chromatogramListPtr
all chromatograms for this run.
Definition: MSData.hpp:830