ProteoWizard
Functions | Variables
ReferencesTest.cpp File Reference
#include "References.hpp"
#include "pwiz/utility/misc/unit.hpp"
#include "pwiz/utility/misc/Std.hpp"
#include "pwiz/utility/minimxml/XMLWriter.hpp"

Go to the source code of this file.

Functions

void testParamContainer ()
void testFileDescription ()
void testComponentList ()
void testInstrumentConfiguration ()
void testDataProcessing ()
void testScanSettings ()
void testPrecursor ()
void testProduct ()
void testScan ()
void testScanList ()
void testBinaryDataArray ()
void testSpectrum ()
void testChromatogram ()
void testRun ()
void testMSData ()
void test ()
int main (int argc, char *argv[])

Variables

ostream * os_ = 0

Function Documentation

void testParamContainer ( )

Definition at line 38 of file ReferencesTest.cpp.

References MS_reflectron_off, MS_reflectron_on, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), and unit_assert.

{
if (os_) *os_ << "testParamContainer()\n";
pc.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg1")));
pc.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg2")));
MSData msd;
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg2")));
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg1")));
msd.paramGroupPtrs[0]->cvParams.push_back(MS_reflectron_on);
msd.paramGroupPtrs[1]->cvParams.push_back(MS_reflectron_off);
unit_assert(pc.paramGroupPtrs[0]->cvParams.empty());
unit_assert(pc.paramGroupPtrs[1]->cvParams.empty());
unit_assert(pc.paramGroupPtrs[0]->cvParams.size() == 1);
unit_assert(pc.paramGroupPtrs[1]->cvParams.size() == 1);
}
void testFileDescription ( )

Definition at line 64 of file ReferencesTest.cpp.

References pwiz::msdata::FileDescription::contacts, pwiz::msdata::FileDescription::fileContent, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), pwiz::msdata::FileDescription::sourceFilePtrs, and unit_assert.

{
if (os_) *os_ << "testFileDescription()\n";
fd.sourceFilePtrs.back()->paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg2")));
fd.sourceFilePtrs.back()->paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg3")));
fd.contacts.push_back(Contact());
fd.contacts.back().paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg4")));
fd.contacts.push_back(Contact());
fd.contacts.back().paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg5")));
MSData msd;
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg5")));
msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user5"));
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg4")));
msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user4"));
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg3")));
msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user3"));
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg2")));
msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user2"));
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg1")));
msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user1"));
unit_assert(!fd.fileContent.paramGroupPtrs[0]->userParams.empty() &&
fd.fileContent.paramGroupPtrs[0]->userParams[0].name == "user1");
unit_assert(!fd.sourceFilePtrs[0]->paramGroupPtrs[0]->userParams.empty() &&
fd.sourceFilePtrs[0]->paramGroupPtrs[0]->userParams[0].name == "user2");
unit_assert(!fd.sourceFilePtrs[1]->paramGroupPtrs[0]->userParams.empty() &&
fd.sourceFilePtrs[1]->paramGroupPtrs[0]->userParams[0].name == "user3");
unit_assert(!fd.contacts[0].paramGroupPtrs[0]->userParams.empty() &&
fd.contacts[0].paramGroupPtrs[0]->userParams[0].name == "user4");
unit_assert(!fd.contacts[1].paramGroupPtrs[0]->userParams.empty() &&
fd.contacts[1].paramGroupPtrs[0]->userParams[0].name == "user5");
}
void testComponentList ( )

Definition at line 110 of file ReferencesTest.cpp.

References pwiz::msdata::ComponentList::analyzer(), pwiz::msdata::ComponentType_Analyzer, pwiz::msdata::ComponentType_Detector, pwiz::msdata::ComponentType_Source, pwiz::msdata::ComponentList::detector(), os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), pwiz::msdata::ComponentList::source(), and unit_assert.

{
if (os_) *os_ << "testComponentList()\n";
ComponentList componentList;
componentList.push_back(Component(ComponentType_Source, 1));
componentList.push_back(Component(ComponentType_Analyzer, 2));
componentList.push_back(Component(ComponentType_Detector, 3));
componentList.source(0).paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
componentList.analyzer(0).paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
componentList.detector(0).paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
MSData msd;
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
References::resolve(componentList, msd);
unit_assert(!componentList.source(0).paramGroupPtrs[0]->userParams.empty());
unit_assert(!componentList.analyzer(0).paramGroupPtrs[0]->userParams.empty());
unit_assert(!componentList.detector(0).paramGroupPtrs[0]->userParams.empty());
}
void testInstrumentConfiguration ( )

Definition at line 134 of file ReferencesTest.cpp.

References pwiz::msdata::InstrumentConfiguration::componentList, pwiz::msdata::ComponentType_Source, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), pwiz::msdata::InstrumentConfiguration::softwarePtr, pwiz::msdata::MSData::softwarePtrs, pwiz::msdata::ComponentList::source(), and unit_assert.

{
if (os_) *os_ << "testInstrumentConfiguration()\n";
InstrumentConfiguration instrumentConfiguration;
instrumentConfiguration.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
instrumentConfiguration.componentList.push_back(Component(ComponentType_Source, 1));
instrumentConfiguration.componentList.source(0).paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
instrumentConfiguration.softwarePtr = SoftwarePtr(new Software("msdata"));
MSData msd;
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
msd.softwarePtrs.push_back(SoftwarePtr(new Software("booger")));
msd.softwarePtrs.push_back(SoftwarePtr(new Software("msdata")));
msd.softwarePtrs[1]->version = "4.20";
unit_assert(instrumentConfiguration.softwarePtr->version.empty());
unit_assert(instrumentConfiguration.paramGroupPtrs[0]->userParams.empty());
References::resolve(instrumentConfiguration, msd);
unit_assert(!instrumentConfiguration.paramGroupPtrs[0]->userParams.empty());
unit_assert(!instrumentConfiguration.componentList.source(0).paramGroupPtrs[0]->userParams.empty());
unit_assert(instrumentConfiguration.softwarePtr->version == "4.20");
}
void testDataProcessing ( )

Definition at line 162 of file ReferencesTest.cpp.

References os_, pwiz::msdata::MSData::paramGroupPtrs, pwiz::msdata::DataProcessing::processingMethods, pwiz::identdata::References::resolve(), pwiz::msdata::MSData::softwarePtrs, and unit_assert.

{
if (os_) *os_ << "testDataProcessing()\n";
DataProcessing dataProcessing;
dataProcessing.processingMethods.push_back(ProcessingMethod());
dataProcessing.processingMethods.back().paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
dataProcessing.processingMethods.back().softwarePtr = SoftwarePtr(new Software("msdata"));
MSData msd;
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
msd.softwarePtrs.push_back(SoftwarePtr(new Software("booger")));
msd.softwarePtrs.push_back(SoftwarePtr(new Software("msdata")));
msd.softwarePtrs[1]->version = "4.20";
unit_assert(dataProcessing.processingMethods.back().softwarePtr->version.empty());
unit_assert(dataProcessing.processingMethods.back().paramGroupPtrs[0]->userParams.empty());
References::resolve(dataProcessing, msd);
unit_assert(!dataProcessing.processingMethods.back().paramGroupPtrs[0]->userParams.empty());
unit_assert(dataProcessing.processingMethods.back().softwarePtr->version == "4.20");
}
void testScanSettings ( )

Definition at line 188 of file ReferencesTest.cpp.

References pwiz::msdata::MSData::fileDescription, os_, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), pwiz::msdata::FileDescription::sourceFilePtrs, pwiz::msdata::ScanSettings::sourceFilePtrs, pwiz::msdata::ScanSettings::targets, and unit_assert.

{
if (os_) *os_ << "testScanSettings()\n";
ScanSettings scanSettings;
scanSettings.targets.push_back(Target());
scanSettings.targets.back().paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
scanSettings.sourceFilePtrs.push_back(SourceFilePtr(new SourceFile("sf2")));
scanSettings.sourceFilePtrs.push_back(SourceFilePtr(new SourceFile("sf1")));
MSData msd;
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
msd.fileDescription.sourceFilePtrs.back()->name = "goo1.raw";
msd.fileDescription.sourceFilePtrs.back()->name = "goo2.raw";
unit_assert(scanSettings.targets.back().paramGroupPtrs[0]->userParams.empty());
unit_assert(scanSettings.sourceFilePtrs[0]->name.empty());
unit_assert(scanSettings.sourceFilePtrs[1]->name.empty());
References::resolve(scanSettings, msd);
unit_assert(!scanSettings.targets.back().paramGroupPtrs.empty());
unit_assert(!scanSettings.targets.back().paramGroupPtrs[0]->userParams.empty());
unit_assert(scanSettings.sourceFilePtrs[0]->name == "goo2.raw");
unit_assert(scanSettings.sourceFilePtrs[1]->name == "goo1.raw");
}
void testPrecursor ( )

Definition at line 219 of file ReferencesTest.cpp.

References pwiz::msdata::Precursor::activation, pwiz::msdata::Precursor::isolationWindow, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), pwiz::msdata::Precursor::selectedIons, and unit_assert.

{
if (os_) *os_ << "testPrecursor()\n";
Precursor precursor;
precursor.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
precursor.selectedIons.resize(1);
precursor.selectedIons[0].paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
precursor.activation.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
precursor.isolationWindow.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
MSData msd;
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
unit_assert(precursor.paramGroupPtrs[0]->userParams.empty());
unit_assert(precursor.selectedIons[0].paramGroupPtrs[0]->userParams.empty());
unit_assert(precursor.activation.paramGroupPtrs[0]->userParams.empty());
unit_assert(precursor.isolationWindow.paramGroupPtrs[0]->userParams.empty());
References::resolve(precursor, msd);
unit_assert(!precursor.paramGroupPtrs[0]->userParams.empty());
unit_assert(!precursor.selectedIons[0].paramGroupPtrs[0]->userParams.empty());
unit_assert(!precursor.activation.paramGroupPtrs[0]->userParams.empty());
unit_assert(!precursor.isolationWindow.paramGroupPtrs[0]->userParams.empty());
}
void testProduct ( )

Definition at line 248 of file ReferencesTest.cpp.

References pwiz::msdata::Product::isolationWindow, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), and unit_assert.

{
if (os_) *os_ << "testProduct()\n";
Product product;
product.isolationWindow.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
MSData msd;
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
unit_assert(product.isolationWindow.paramGroupPtrs[0]->userParams.empty());
References::resolve(product, msd);
unit_assert(!product.isolationWindow.paramGroupPtrs[0]->userParams.empty());
}
void testScan ( )

Definition at line 267 of file ReferencesTest.cpp.

References pwiz::msdata::Scan::instrumentConfigurationPtr, pwiz::msdata::MSData::instrumentConfigurationPtrs, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), pwiz::msdata::Scan::scanWindows, and unit_assert.

{
if (os_) *os_ << "testScan()\n";
Scan scan;
scan.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
scan.scanWindows.push_back(ScanWindow());
scan.scanWindows.back().paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
MSData msd;
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
msd.instrumentConfigurationPtrs.push_back(InstrumentConfigurationPtr(new InstrumentConfiguration("instrumentConfiguration")));
msd.instrumentConfigurationPtrs.back()->userParams.push_back(UserParam("user"));
unit_assert(scan.paramGroupPtrs[0]->userParams.empty());
unit_assert(scan.instrumentConfigurationPtr->userParams.empty());
unit_assert(scan.scanWindows.back().paramGroupPtrs.back()->userParams.empty());
References::resolve(scan, msd);
unit_assert(!scan.paramGroupPtrs[0]->userParams.empty());
unit_assert(!scan.instrumentConfigurationPtr->userParams.empty());
unit_assert(!scan.scanWindows.back().paramGroupPtrs.back()->userParams.empty());
}
void testScanList ( )

Definition at line 295 of file ReferencesTest.cpp.

References os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), pwiz::msdata::ScanList::scans, and unit_assert.

{
if (os_) *os_ << "testScanList()\n";
ScanList scanList;
scanList.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
scanList.scans.push_back(Scan());
Scan& scan = scanList.scans.back();
scan.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
MSData msd;
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
unit_assert(scanList.paramGroupPtrs[0]->userParams.empty());
unit_assert(scan.paramGroupPtrs[0]->userParams.empty());
References::resolve(scanList, msd);
unit_assert(!scanList.paramGroupPtrs[0]->userParams.empty());
unit_assert(!scan.paramGroupPtrs[0]->userParams.empty());
}
void testBinaryDataArray ( )

Definition at line 320 of file ReferencesTest.cpp.

References pwiz::msdata::BinaryDataArray::dataProcessingPtr, pwiz::msdata::MSData::dataProcessingPtrs, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), and unit_assert.

{
if (os_) *os_ << "testBinaryDataArray()\n";
BinaryDataArray binaryDataArray;
binaryDataArray.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
binaryDataArray.dataProcessingPtr = DataProcessingPtr(new DataProcessing("msdata"));
MSData msd;
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
msd.dataProcessingPtrs.push_back(DataProcessingPtr(new DataProcessing("msdata")));
msd.dataProcessingPtrs.back()->processingMethods.push_back(ProcessingMethod());
msd.dataProcessingPtrs.back()->processingMethods.back().softwarePtr = SoftwarePtr(new Software("software"));
unit_assert(binaryDataArray.paramGroupPtrs.back()->userParams.empty());
unit_assert(binaryDataArray.dataProcessingPtr->processingMethods.empty());
References::resolve(binaryDataArray, msd);
unit_assert(!binaryDataArray.paramGroupPtrs.back()->userParams.empty());
unit_assert(binaryDataArray.dataProcessingPtr->processingMethods.size() == 1);
unit_assert(binaryDataArray.dataProcessingPtr->processingMethods.back().softwarePtr.get());
}
void testSpectrum ( )

Definition at line 346 of file ReferencesTest.cpp.

References pwiz::msdata::Spectrum::binaryDataArrayPtrs, pwiz::msdata::Spectrum::dataProcessingPtr, pwiz::msdata::MSData::dataProcessingPtrs, pwiz::msdata::MSData::fileDescription, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::msdata::Spectrum::precursors, pwiz::msdata::Spectrum::products, pwiz::identdata::References::resolve(), pwiz::msdata::Spectrum::scanList, pwiz::msdata::Spectrum::sourceFilePtr, pwiz::msdata::FileDescription::sourceFilePtrs, and unit_assert.

{
if (os_) *os_ << "testSpectrum()\n";
Spectrum spectrum;
spectrum.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
spectrum.sourceFilePtr = SourceFilePtr(new SourceFile("sf"));
spectrum.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
spectrum.scanList.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
spectrum.precursors.push_back(Precursor());
spectrum.precursors.back().paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
spectrum.products.push_back(Product());
spectrum.products.back().isolationWindow.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
spectrum.binaryDataArrayPtrs.back()->paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
MSData msd;
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
msd.dataProcessingPtrs.back()->processingMethods.push_back(ProcessingMethod());
msd.dataProcessingPtrs.back()->processingMethods.back().softwarePtr = SoftwarePtr(new Software("software"));
msd.fileDescription.sourceFilePtrs.back()->name = "goo.raw";
unit_assert(spectrum.paramGroupPtrs.back()->userParams.empty());
unit_assert(spectrum.dataProcessingPtr->processingMethods.empty());
unit_assert(spectrum.sourceFilePtr->name.empty());
unit_assert(spectrum.paramGroupPtrs.back()->userParams.empty());
unit_assert(spectrum.scanList.paramGroupPtrs.back()->userParams.empty());
unit_assert(spectrum.precursors.back().paramGroupPtrs.back()->userParams.empty());
unit_assert(spectrum.products.back().isolationWindow.paramGroupPtrs.back()->userParams.empty());
unit_assert(spectrum.binaryDataArrayPtrs.back()->paramGroupPtrs.back()->userParams.empty());
References::resolve(spectrum, msd);
unit_assert(!spectrum.paramGroupPtrs.back()->userParams.empty());
unit_assert(spectrum.dataProcessingPtr->processingMethods.size() == 1);
unit_assert(spectrum.dataProcessingPtr->processingMethods.back().softwarePtr.get());
unit_assert(spectrum.sourceFilePtr->name == "goo.raw");
unit_assert(!spectrum.paramGroupPtrs.back()->userParams.empty());
unit_assert(!spectrum.scanList.paramGroupPtrs.back()->userParams.empty());
unit_assert(!spectrum.precursors.back().paramGroupPtrs.back()->userParams.empty());
unit_assert(!spectrum.products.back().isolationWindow.paramGroupPtrs.back()->userParams.empty());
unit_assert(!spectrum.binaryDataArrayPtrs.back()->paramGroupPtrs.back()->userParams.empty());
}
void testChromatogram ( )

Definition at line 398 of file ReferencesTest.cpp.

References pwiz::msdata::Chromatogram::binaryDataArrayPtrs, pwiz::msdata::Chromatogram::dataProcessingPtr, pwiz::msdata::MSData::dataProcessingPtrs, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), and unit_assert.

{
if (os_) *os_ << "testChromatogram()\n";
Chromatogram chromatogram;
chromatogram.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
chromatogram.binaryDataArrayPtrs.back()->paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
MSData msd;
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
msd.dataProcessingPtrs.back()->processingMethods.push_back(ProcessingMethod());
msd.dataProcessingPtrs.back()->processingMethods.back().softwarePtr = SoftwarePtr(new Software("software"));
unit_assert(chromatogram.paramGroupPtrs.back()->userParams.empty());
unit_assert(chromatogram.dataProcessingPtr->processingMethods.empty());
unit_assert(chromatogram.binaryDataArrayPtrs.back()->paramGroupPtrs.back()->userParams.empty());
References::resolve(chromatogram, msd);
unit_assert(!chromatogram.paramGroupPtrs.back()->userParams.empty());
unit_assert(chromatogram.dataProcessingPtr->processingMethods.size() == 1);
unit_assert(chromatogram.dataProcessingPtr->processingMethods.back().softwarePtr.get());
unit_assert(!chromatogram.binaryDataArrayPtrs.back()->paramGroupPtrs.back()->userParams.empty());
}
void testRun ( )

Definition at line 428 of file ReferencesTest.cpp.

References pwiz::msdata::Run::defaultInstrumentConfigurationPtr, pwiz::msdata::Run::defaultSourceFilePtr, pwiz::msdata::MSData::fileDescription, pwiz::msdata::MSData::instrumentConfigurationPtrs, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), pwiz::msdata::Run::samplePtr, pwiz::msdata::MSData::samplePtrs, pwiz::msdata::FileDescription::sourceFilePtrs, and unit_assert.

{
if (os_) *os_ << "testRun()\n";
Run run;
run.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
run.samplePtr = SamplePtr(new Sample("sample"));
MSData msd;
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
msd.instrumentConfigurationPtrs.push_back(InstrumentConfigurationPtr(new InstrumentConfiguration("instrumentConfiguration")));
msd.instrumentConfigurationPtrs.back()->userParams.push_back(UserParam("user"));
msd.samplePtrs.push_back(SamplePtr(new Sample("sample")));
msd.samplePtrs.back()->name = "sample name";
msd.fileDescription.sourceFilePtrs.back()->name = "goo1.raw";
msd.fileDescription.sourceFilePtrs.back()->name = "goo2.raw";
unit_assert(run.paramGroupPtrs.back()->userParams.empty());
unit_assert(run.samplePtr->name.empty());
unit_assert(run.defaultSourceFilePtr->name.empty());
unit_assert(!run.paramGroupPtrs.back()->userParams.empty());
unit_assert(run.samplePtr->name == "sample name");
unit_assert(run.defaultSourceFilePtr->name == "goo2.raw");
}
void testMSData ( )

Definition at line 464 of file ReferencesTest.cpp.

References pwiz::msdata::MSData::dataProcessingPtrs, pwiz::msdata::FileDescription::fileContent, pwiz::msdata::MSData::fileDescription, pwiz::msdata::MSData::instrumentConfigurationPtrs, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), pwiz::msdata::MSData::run, pwiz::msdata::MSData::samplePtrs, and unit_assert.

{
if (os_) *os_ << "testMSData()\n";
MSData msd;
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg1")));
msd.paramGroupPtrs.back()->paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg2")));
msd.paramGroupPtrs.back()->paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
msd.samplePtrs.push_back(SamplePtr(new Sample("sample")));
msd.samplePtrs.back()->paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
msd.instrumentConfigurationPtrs.push_back(InstrumentConfigurationPtr(new InstrumentConfiguration("instrumentConfiguration")));
msd.instrumentConfigurationPtrs.back()->paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
msd.dataProcessingPtrs.back()->processingMethods.push_back(ProcessingMethod());
msd.dataProcessingPtrs.back()->processingMethods.back().paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
msd.run.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
unit_assert(msd.paramGroupPtrs[1]->paramGroupPtrs.back()->userParams.empty());
unit_assert(msd.paramGroupPtrs[2]->paramGroupPtrs.back()->userParams.empty());
unit_assert(msd.samplePtrs.back()->paramGroupPtrs.back()->userParams.empty());
unit_assert(msd.instrumentConfigurationPtrs.back()->paramGroupPtrs.back()->userParams.empty());
unit_assert(msd.dataProcessingPtrs.back()->processingMethods.back().paramGroupPtrs.back()->userParams.empty());
unit_assert(msd.run.paramGroupPtrs.back()->userParams.empty());
unit_assert(!msd.paramGroupPtrs[1]->paramGroupPtrs.back()->userParams.empty());
unit_assert(!msd.paramGroupPtrs[2]->paramGroupPtrs.back()->userParams.empty());
unit_assert(!msd.samplePtrs.back()->paramGroupPtrs.back()->userParams.empty());
unit_assert(!msd.instrumentConfigurationPtrs.back()->paramGroupPtrs.back()->userParams.empty());
unit_assert(!msd.dataProcessingPtrs.back()->processingMethods.back().paramGroupPtrs.back()->userParams.empty());
unit_assert(!msd.run.paramGroupPtrs.back()->userParams.empty());
}
void test ( )
int main ( int  argc,
char *  argv[] 
)

Definition at line 524 of file ReferencesTest.cpp.

References e(), os_, test(), TEST_EPILOG, TEST_FAILED, and TEST_PROLOG_EX.

{
TEST_PROLOG_EX(argc, argv, "_MSData")
try
{
if (argc>1 && !strcmp(argv[1],"-v")) os_ = &cout;
test();
}
catch (exception& e)
{
TEST_FAILED(e.what())
}
catch (...)
{
TEST_FAILED("Caught unknown exception.")
}
}

Variable Documentation

ostream* os_ = 0

Definition at line 35 of file ReferencesTest.cpp.