This repository was archived by the owner on Sep 22, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ private void RefillBuffer()
107107 * as we overran the stream and wanna hit the throw above.
108108 */
109109 Offset -= BitsInBuffer + 1 ;
110+ LazyGlobalPosition += BitsInBuffer + 1 ;
110111 * ( uint * ) PBuffer = 0 ; // safety
111112 BitsInBuffer = 0 ;
112113 continue ;
Original file line number Diff line number Diff line change @@ -342,6 +342,28 @@ public void TestChunkNestingRandomExhaustive()
342342 }
343343 Assert . Fail ( "Should have thrown" ) ;
344344 }
345+
346+ [ Test ]
347+ public void TestStreamEndChunkBoundary ( )
348+ {
349+ dbgAll . BeginChunk ( data . Length * 8 ) ;
350+ Assert . IsFalse ( dbgAll . ChunkFinished ) ;
351+ dbgAll . BeginChunk ( data . Length * 8 ) ;
352+ Assert . IsFalse ( dbgAll . ChunkFinished ) ;
353+ dbgAll . EndChunk ( ) ;
354+ Assert . IsTrue ( dbgAll . ChunkFinished ) ;
355+ dbgAll . EndChunk ( ) ;
356+ }
357+
358+ [ Test ]
359+ public void TestStreamEndChunkBoundaryData ( )
360+ {
361+ dbgAll . BeginChunk ( data . Length * 8 ) ;
362+ Assert . IsFalse ( dbgAll . ChunkFinished ) ;
363+ dbgAll . ReadBytes ( data . Length ) ;
364+ Assert . IsTrue ( dbgAll . ChunkFinished ) ;
365+ dbgAll . EndChunk ( ) ;
366+ }
345367 }
346368}
347369
You can’t perform that action at this time.
0 commit comments