31 using namespace pwiz::msdata;
32 using namespace pwiz::util;
33 using namespace pwiz::minimxml;
40 "PEPMASS=810.790000\n"
41 "TITLE=small.pwiz.0003.0003.2\n"
42 "231.388840 26.545113\n"
43 "233.339828 20.447954\n"
44 "239.396149 17.999159\n"
47 "PEPMASS=837.340000\n"
48 "TITLE=small.pwiz.0004.0004.2\n"
49 "RTINSECONDS=123.456\n"
51 "236.047043 11.674493\n"
52 "237.237091 24.431984\n"
53 "238.824036 10.019409\n"
54 "239.531403 6.842983\n"
55 "243.128693 89.586212\n"
60 if (
os_) *
os_ <<
"test()\n";
64 shared_ptr<istream> is(
new istringstream(
testMGF));
90 IndexList list = sl->findSpotID(
"small.pwiz.0004.0004.2");
96 list = sl->findSpotID(
"fake title string");
102 unit_assert(sl->spectrumIdentity(0).id ==
"index=0");
103 unit_assert(sl->spectrumIdentity(0).sourceFilePosition != -1);
118 Precursor& precursor0 = s->precursors[0];
125 s = sl->spectrum(0,
true);
128 unit_assert(!s->binaryDataArrayPtrs[0]->data.empty() && !s->binaryDataArrayPtrs[1]->data.empty());
130 vector<MZIntensityPair> pairs;
131 s->getMZIntensityPairs(pairs);
136 copy(pairs.begin(), pairs.end(), ostream_iterator<MZIntensityPair>(*
os_,
"\n"));
144 unit_assert(sl->spectrumIdentity(1).id ==
"index=1");
146 s = sl->spectrum(1,
true);
157 Precursor& precursor1 = s->precursors[0];
165 s->getMZIntensityPairs(pairs);
167 unit_assert(s->defaultArrayLength == pairs.size());
172 copy(pairs.begin(), pairs.end(), ostream_iterator<MZIntensityPair>(*
os_,
"\n"));
178 int main(
int argc,
char* argv[])
184 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;