mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
fixed bug in SequenceNumberStats and its unit test; test passes now
This commit is contained in:
parent
ab503583dd
commit
059628c26a
2 changed files with 14 additions and 2 deletions
|
@ -94,6 +94,7 @@ void SequenceNumberStats::sequenceNumberReceived(quint16 incoming, QUuid senderU
|
|||
|
||||
_numEarly++;
|
||||
_numLost += (incomingInt - expectedInt);
|
||||
_lastReceived = incoming;
|
||||
|
||||
// add all sequence numbers that were skipped to the missing sequence numbers list
|
||||
for (int missingInt = expectedInt; missingInt < incomingInt; missingInt++) {
|
||||
|
@ -105,8 +106,6 @@ void SequenceNumberStats::sequenceNumberReceived(quint16 incoming, QUuid senderU
|
|||
if (_missingSet.size() > MAX_REASONABLE_SEQUENCE_GAP) {
|
||||
pruneMissingSet(wantExtraDebugging);
|
||||
}
|
||||
|
||||
_lastReceived = incoming;
|
||||
} else { // late
|
||||
if (wantExtraDebugging) {
|
||||
qDebug() << "this packet is later than expected...";
|
||||
|
|
|
@ -115,6 +115,11 @@ void SequenceNumberStatsTests::earlyLateTest() {
|
|||
}
|
||||
}
|
||||
stats.reset();
|
||||
numSent = 0;
|
||||
numEarly = 0;
|
||||
numLate = 0;
|
||||
numLost = 0;
|
||||
numRecovered = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -203,6 +208,11 @@ void SequenceNumberStatsTests::duplicateTest() {
|
|||
}
|
||||
}
|
||||
stats.reset();
|
||||
numSent = 0;
|
||||
numDuplicate = 0;
|
||||
numEarly = 0;
|
||||
numLate = 0;
|
||||
numLost = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -263,5 +273,8 @@ void SequenceNumberStatsTests::pruneTest() {
|
|||
}
|
||||
}
|
||||
stats.reset();
|
||||
numSent = 0;
|
||||
numEarly = 0;
|
||||
numLost = 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue