Skip to content

Commit

Permalink
Add assertion to check the size of the packet once encoded
Browse files Browse the repository at this point in the history
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
  • Loading branch information
atoulme committed May 9, 2021
1 parent 5afa755 commit 30db95f
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ public void neighborsPacketLimited() {
neighborsPacket.packet.getPacketData(NeighborsPacketData.class).get();
assertThat(neighbors).isNotNull();
assertThat(neighbors.getNodes()).hasSize(13);
assertThat(neighborsPacket.packet.encode().length()).isLessThanOrEqualTo(1280); // under max MTU

// Assert that after removing those 13 items we're left with either 4 or 5.
// If we are left with 5, the test peer was returned as an item, assert that this is the case.
Expand Down

0 comments on commit 30db95f

Please sign in to comment.