Repository navigation
test(pcapng,sctp): replace dead checks with ones that can fail (#2226) - #2238
Merged
Merged
Conversation
Owner
Author
|
Review: NEEDS CHANGES at
|
Three checks could not fail: a != 104 size check no tree produces, a BitField probe gating the SCTP mixed-bit round trip that is always true, and a NOTE excusing the PCAP-NG side of the cap_len/packet equality. - test_dumped_pcap_carries_the_payload_octets: drop the != 104 line; the exact-size assertEqual above it is what catches #646, and the comment now says so. - test_sctp_unit: drop bitfield_packs_zero_bits and its skipTest; the mixed-bit test runs unconditionally. - test_block2frame_puts_the_on_wire_length_in_len: assert cap_len == len(frame.packet) and drop the NOTE.
JarryShaw
force-pushed
the
test/2226-dead-checks
branch
from
October 26, 2026 03:55
5ff243c to
1e8c7f7
Compare
Owner
Author
|
Review: GOOD TO GO at
|
Contributor
|
Coverage: 91.56% (unit tier, Python 3.15,
Per-file detail: the |
Owner
Author
|
Ready to merge at
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
test— tests onlyDescription
Closes #2226. Three checks could not fail on
main.test_dumped_pcap_carries_the_payload_octets: the vacuousassertNotEqual(len(dumped), 104)goes. The exact-sizeassertEqualabove it is what catches every PCAP-NG packet block loses its payload octets:packetis computed then overwritten with b'', so dumping through PCAPIO writes a record header claiming 314 octets followed by none #646, and the comment says so. Atdf23f7e6f^that assertion fails before the deleted line is reached.test_sctp_unit: thebitfield_packs_zero_bitsprobe and itsskipTestare gone. WithBitField.pre_processpatched back to the old bug,main's copy skips and this one fails (True is not false).test_block2frame_puts_the_on_wire_length_in_len: addsassertEqual(frame.cap_len, len(frame.packet))and drops the NOTE that excused it. Withblock2framepatched to return one octet short,main's copy passes and this one fails (314 != 313).test_chunk_flags_round_trip_with_mixed_bitsnow runs.