| 91 | } |
| 92 | |
| 93 | void cmpDataRT(const MSExperiment& exp1, const MSExperiment& exp2, double abs_tol = 1e-5, double rel_tol = 1+1e-5) |
| 94 | { |
| 95 | // Logic of comparison: if the absolute difference criterion is fulfilled, |
| 96 | // the relative one does not matter. If the absolute difference is larger |
| 97 | // than allowed, the test does not fail if the relative difference is less |
| 98 | // than allowed. |
| 99 | // Note that the sample spectrum intensity has a very large range, from |
| 100 | // 0.00013 to 183 838 intensity and encoding both values with high accuracy |
| 101 | // is difficult. |
| 102 | |
| 103 | TOLERANCE_ABSOLUTE(abs_tol) |
| 104 | TOLERANCE_RELATIVE(rel_tol) |
| 105 | for (Size i = 0; i < exp1.getNrChromatograms(); i++) |
| 106 | { |
| 107 | TEST_EQUAL(exp1.getChromatograms()[i].size() == exp2.getChromatograms()[i].size(), true) |
| 108 | for (Size k = 0; k < exp1.getChromatograms()[i].size(); k++) |
| 109 | { |
| 110 | auto a = exp1.getChromatograms()[i][k].getRT(); |
| 111 | auto b = exp2.getChromatograms()[i][k].getRT(); |
| 112 | // avoid the console clutter if nothing interesing happens |
| 113 | if (!TEST::isRealSimilar(a, b)) TEST_REAL_SIMILAR(a, b) |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | |
| 119 | START_TEST(SqMassFile, "$Id$") |
no test coverage detected