Add test for non-empty waypoint file

This commit is contained in:
Tim Schubert 2020-07-07 15:21:14 +02:00
parent 42787c2b41
commit e1bca0b7d9
3 changed files with 57 additions and 5 deletions

View file

@ -63,13 +63,16 @@ LeoWaypointInputFileStreamContainer::GetNextSample (Waypoint &sample)
NS_ABORT_MSG ("Input stream is bad");
}
while (!m_input.eof () && sample.time < m_lastTime)
Time newLast = m_lastTime;
while (m_input && sample.time < m_lastTime)
{
m_input >> sample;
newLast = sample.time;
}
m_lastTime = sample.time;
bool res = (newLast != m_lastTime) && m_input;
m_lastTime = newLast;
return m_input.good ();
return res;
}
void