Unit tests for IncomingErrorCorrectionLayerImpl.

This commit is contained in:
akwizgran
2012-01-20 19:56:18 +00:00
parent 114ca203d8
commit 337c1c8ac4
3 changed files with 176 additions and 1 deletions

View File

@@ -46,7 +46,7 @@ class IncomingErrorCorrectionLayerImpl implements IncomingErrorCorrectionLayer {
if(window.contains(frameNumber)) break;
if(window.isTooHigh(frameNumber)) countDiscard(frameNumber);
}
// Add the segment to its segment set, or create one if necessary
// Add the segment to its set, creating a set if necessary
Segment[] set = segmentSets.get(frameNumber);
if(set == null) {
set = new Segment[n];
@@ -64,4 +64,14 @@ class IncomingErrorCorrectionLayerImpl implements IncomingErrorCorrectionLayer {
else if(count == n - k) throw new FormatException();
else discardCounts.put(frameNumber, count + 1);
}
// Only for testing
Map<Long, Segment[]> getSegmentSets() {
return segmentSets;
}
// Only for testing
Map<Long, Integer> getDiscardCounts() {
return discardCounts;
}
}