Skip to content

Commit

Permalink
Checkpoint 1 update: add extra test for Reassembler
Browse files Browse the repository at this point in the history
  • Loading branch information
keithw committed Apr 17, 2023
1 parent 8a463b5 commit 966a6d7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/reassembler_overlapping.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,25 @@ int main()
test.execute( BytesPending( 0 ) );
}

{
// Hole filled progressively and with overlap. Credit: Sarah McCarthy

ReassemblerTestHarness test { "hole filled with overlap", 20 };

test.execute( Insert { "fgh", 5 } );
test.execute( BytesPushed( 0 ) );
test.execute( ReadAll( "" ) );
test.execute( IsFinished { false } );

test.execute( Insert { "abc", 0 } );
test.execute( BytesPushed( 3 ) );

test.execute( Insert { "abcdef", 0 } );
test.execute( BytesPushed( 8 ) );
test.execute( BytesPending( 0 ) );
test.execute( ReadAll( "abcdefgh" ) );
}

} catch ( const exception& e ) {
cerr << "Exception: " << e.what() << endl;
return EXIT_FAILURE;
Expand Down

0 comments on commit 966a6d7

Please sign in to comment.