30 #include <boost/filesystem/operations.hpp>
33 using namespace pwiz::util;
34 using namespace pwiz::data;
42 ifstream file1(filename1.c_str()), file2(filename2.c_str());
44 while (getline(file1, line1) && getline(file2, line2))
46 if (
os_) *
os_ <<
"diff " << filename1 <<
" " << filename2 <<
": success\n";
58 for (
int i=-5; i<=5; i++)
78 string filename2 =
"FrequencyDataTest.output2.txt";
93 if (
os_) *
os_ <<
"Writing " << filename2 << endl;
98 string filename3 =
"FrequencyDataTest.output3.txt";
100 if (
os_) *
os_ <<
"Writing " << filename3 << endl;
103 ofstream os(filename3.c_str(), ios::app);
114 string filename4a =
"FrequencyDataTest.output4a.txt";
115 if (
os_) *
os_ <<
"Writing " << filename4a << endl;
117 string filenameBinary1 =
"FrequencyDataTest.output1.cfd";
118 if (
os_) *
os_ <<
"Writing " << filenameBinary1 << endl;
119 fd.
write(filenameBinary1);
130 string filename4b =
"FrequencyDataTest.output4b.txt";
131 if (
os_) *
os_ <<
"Writing " << filename4b << endl;
133 diff(filename4a, filename4b);
140 string filename5 =
"FrequencyDataTest.output5.txt";
141 if (
os_) *
os_ <<
"Writing " << filename5 << endl;
142 ofstream os5(filename5.c_str());
205 if (
os_) *
os_ <<
"Deleting FrequencyDataTest.output*.txt\n";
206 vector<bfs::path> filepaths;
208 for (
size_t i=0; i < filepaths.size(); ++i)
209 boost::filesystem::remove(filepaths[i]);
215 if (
os_) *
os_ <<
"testNoiseFloorVarianceCalculation()\n";
216 if (
os_) *
os_ << setprecision(10);
220 string filename =
"FrequencyDataTest.cfd.temp.txt";
221 ofstream temp(filename.c_str());
226 boost::filesystem::remove(filename);
229 if (
os_) *
os_ <<
"result: " << result << endl;
242 if (
os_) *
os_ <<
"result2: " << result2 << endl;
247 int main(
int argc,
char* argv[])
253 if (argc>1 && !strcmp(argv[1],
"-v"))
256 if (
os_) *
os_ <<
"FrequencyDataTest\n";
265 if (
os_) *
os_ <<
"success\n";