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.

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

Referenced by test().

40 {
41  if (os_) *os_ << "ChromatogramListFactory::usage():\n" << ChromatogramListFactory::usage() << endl;
42 }
ostream * os_

◆ testWrap()

void testWrap ( )

Definition at line 45 of file ChromatogramListFactoryTest.cpp.

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

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 }
ChromatogramListPtr chromatogramListPtr
all chromatograms for this run.
Definition: MSData.hpp:830
boost::shared_ptr< ChromatogramList > ChromatogramListPtr
Definition: MSData.hpp:785
#define unit_assert_operator_equal(expected, actual)
Definition: unit.hpp:92
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...
PWIZ_API_DECL void initializeTiny(IdentData &mzid)
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:849
#define unit_assert(x)
Definition: unit.hpp:85

◆ test()

void test ( )

Definition at line 119 of file ChromatogramListFactoryTest.cpp.

References testUsage(), and testWrap().

Referenced by main().

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

◆ main()

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

Definition at line 127 of file ChromatogramListFactoryTest.cpp.

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

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
ostream * os_
#define TEST_FAILED(x)
Definition: unit.hpp:177
#define TEST_PROLOG(argc, argv)
Definition: unit.hpp:175

Variable Documentation

◆ os_

ostream* os_ = 0

Definition at line 36 of file ChromatogramListFactoryTest.cpp.

Referenced by main(), and testUsage().