33 using namespace pwiz::msdata;
34 using namespace pwiz::util;
50 for (
int i=0; i<=10; i++)
55 spectrum->cvParams.push_back(i%2 ?
61 spectrum->binaryDataArrayPtrs.push_back(bdMZ);
65 spectrum->binaryDataArrayPtrs.push_back(bdIntensity);
67 for (
int j=1; j<=i; j++)
69 bdMZ->data.push_back(j);
70 bdIntensity->data.push_back(100*j);
73 spectrum->defaultArrayLength = i;
74 spectrumList.
spectra.push_back(spectrum);
92 if (
os_) *
os_ <<
"printSpectrumList()\n";
94 for (
unsigned int i=0; i<sl.
size(); i++)
97 os << spectrum->id <<
" "
100 vector<MZIntensityPair> mziPairs;
101 spectrum->getMZIntensityPairs(mziPairs);
102 copy(mziPairs.begin(), mziPairs.end(), ostream_iterator<MZIntensityPair>(os,
""));
110 if (
os_) *
os_ <<
"testBasic()\n";
118 ++it; ++it; ++it; ++it; ++it;
123 it->binaryDataArrayPtrs[0]->data.size() == 5);
129 if (
os_) *
os_ <<
"spectrum: " << spectrum.
id <<
" "
132 vector<MZIntensityPair> pairs;
137 copy(pairs.begin(), pairs.end(), ostream_iterator<MZIntensityPair>(*
os_,
""));
147 if (
os_) *
os_ <<
"testForEach(): \n";
156 if (
os_) *
os_ <<
"testIntegerSet():\n";
159 for (
int i=2; i<=50; i+=2)
181 virtual bool accept(
const Spectrum& spectrum)
const
190 vector<int> ftScanNumbers;
197 back_inserter(ftScanNumbers),
202 *
os_ <<
"testSieve():\n";
203 copy(ftScanNumbers.begin(), ftScanNumbers.end(), ostream_iterator<int>(*
os_,
" "));
218 if (
os_) *
os_ <<
"testIteratorEquality()\n";
236 if (
os_) *
os_ <<
"testMSDataConstruction()\n";
248 if (
os_) *
os_ << it->id <<
" "
251 unit_assert(it->id == lexical_cast<string>(5+i*10));
256 int main(
int argc,
char* argv[])
262 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;