Commit ad194c68 authored by Karl Palmen's avatar Karl Palmen
Browse files

Correct a modified test function re #12827



Signed-off-by: default avatarKarl Palmen <karl.palmen@stfc.ac.uk>
parent 23b4d3e4
...@@ -393,15 +393,17 @@ public: ...@@ -393,15 +393,17 @@ public:
void checkTrackIntercept(Track &track, void checkTrackIntercept(Track &track,
const std::vector<Link> &expectedResults) { const std::vector<Link> &expectedResults) {
int index = 0; int index = 0;
for (Track::LType::const_iterator it = track.cbegin(); for (Track::LType::const_iterator it = track.cbegin(); it != track.cend();
it != track.cend() && index < expectedResults.size(); ++it) { ++it) {
TS_ASSERT_DELTA(it->distFromStart, expectedResults[index].distFromStart, if (index < expectedResults.size()) {
1e-6); TS_ASSERT_DELTA(it->distFromStart, expectedResults[index].distFromStart,
TS_ASSERT_DELTA(it->distInsideObject, 1e-6);
expectedResults[index].distInsideObject, 1e-6); TS_ASSERT_DELTA(it->distInsideObject,
TS_ASSERT_EQUALS(it->componentID, expectedResults[index].componentID); expectedResults[index].distInsideObject, 1e-6);
TS_ASSERT_EQUALS(it->entryPoint, expectedResults[index].entryPoint); TS_ASSERT_EQUALS(it->componentID, expectedResults[index].componentID);
TS_ASSERT_EQUALS(it->exitPoint, expectedResults[index].exitPoint); TS_ASSERT_EQUALS(it->entryPoint, expectedResults[index].entryPoint);
TS_ASSERT_EQUALS(it->exitPoint, expectedResults[index].exitPoint);
}
++index; ++index;
} }
TS_ASSERT_EQUALS(index, static_cast<int>(expectedResults.size())); TS_ASSERT_EQUALS(index, static_cast<int>(expectedResults.size()));
......
...@@ -645,15 +645,17 @@ public: ...@@ -645,15 +645,17 @@ public:
void checkTrackIntercept(Track &track, void checkTrackIntercept(Track &track,
const std::vector<Link> &expectedResults) { const std::vector<Link> &expectedResults) {
int index = 0; int index = 0;
for (Track::LType::const_iterator it = track.cbegin(); for (Track::LType::const_iterator it = track.cbegin(); it != track.cend();
it != track.cend() && index < expectedResults.size(); ++it) { ++it) {
TS_ASSERT_DELTA(it->distFromStart, expectedResults[index].distFromStart, if (index < expectedResults.size()) {
1e-6); TS_ASSERT_DELTA(it->distFromStart, expectedResults[index].distFromStart,
TS_ASSERT_DELTA(it->distInsideObject, 1e-6);
expectedResults[index].distInsideObject, 1e-6); TS_ASSERT_DELTA(it->distInsideObject,
TS_ASSERT_EQUALS(it->componentID, expectedResults[index].componentID); expectedResults[index].distInsideObject, 1e-6);
TS_ASSERT_EQUALS(it->entryPoint, expectedResults[index].entryPoint); TS_ASSERT_EQUALS(it->componentID, expectedResults[index].componentID);
TS_ASSERT_EQUALS(it->exitPoint, expectedResults[index].exitPoint); TS_ASSERT_EQUALS(it->entryPoint, expectedResults[index].entryPoint);
TS_ASSERT_EQUALS(it->exitPoint, expectedResults[index].exitPoint);
}
++index; ++index;
} }
TS_ASSERT_EQUALS(index, static_cast<int>(expectedResults.size())); TS_ASSERT_EQUALS(index, static_cast<int>(expectedResults.size()));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment