mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +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++;
|
_numEarly++;
|
||||||
_numLost += (incomingInt - expectedInt);
|
_numLost += (incomingInt - expectedInt);
|
||||||
|
_lastReceived = incoming;
|
||||||
|
|
||||||
// add all sequence numbers that were skipped to the missing sequence numbers list
|
// add all sequence numbers that were skipped to the missing sequence numbers list
|
||||||
for (int missingInt = expectedInt; missingInt < incomingInt; missingInt++) {
|
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) {
|
if (_missingSet.size() > MAX_REASONABLE_SEQUENCE_GAP) {
|
||||||
pruneMissingSet(wantExtraDebugging);
|
pruneMissingSet(wantExtraDebugging);
|
||||||
}
|
}
|
||||||
|
|
||||||
_lastReceived = incoming;
|
|
||||||
} else { // late
|
} else { // late
|
||||||
if (wantExtraDebugging) {
|
if (wantExtraDebugging) {
|
||||||
qDebug() << "this packet is later than expected...";
|
qDebug() << "this packet is later than expected...";
|
||||||
|
|
|
@ -115,6 +115,11 @@ void SequenceNumberStatsTests::earlyLateTest() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stats.reset();
|
stats.reset();
|
||||||
|
numSent = 0;
|
||||||
|
numEarly = 0;
|
||||||
|
numLate = 0;
|
||||||
|
numLost = 0;
|
||||||
|
numRecovered = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,6 +208,11 @@ void SequenceNumberStatsTests::duplicateTest() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stats.reset();
|
stats.reset();
|
||||||
|
numSent = 0;
|
||||||
|
numDuplicate = 0;
|
||||||
|
numEarly = 0;
|
||||||
|
numLate = 0;
|
||||||
|
numLost = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,5 +273,8 @@ void SequenceNumberStatsTests::pruneTest() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stats.reset();
|
stats.reset();
|
||||||
|
numSent = 0;
|
||||||
|
numEarly = 0;
|
||||||
|
numLost = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue