Commit ab8e997
authored
test(quic): expand coverage for packet (#1040)
Add tests/unit/quic_packet_coverage_test.cpp (57 deterministic GTest
cases) targeting every error path, type-specific branch, and boundary
condition in src/protocols/quic/packet.cpp:
- packet_type_to_string: all named cases plus default branch
- long_header::type / is_retry across all four type bit values
- short_header spin / key-phase bit combinations
- packet_number::encoded_length at every width boundary
- packet_number::decode RFC Appendix A example plus both wrap-around
branches and the no-adjust path
- packet_number::encode big-endian byte ordering and roundtrip across
all four widths
- packet_parser::is_version_negotiation: too-short, short-header,
version-zero long-header, and version-one branches
- packet_parser::parse_header dispatch including error propagation
- packet_parser::parse_long_header: every length / form / dcid / scid /
varint failure plus full success for Initial / Handshake / 0-RTT /
Retry
- packet_parser::parse_short_header: insufficient data, wrong form,
invalid fixed bit, zero-length DCID skip, and roundtrip
- packet_builder::build dispatch over both header structures with shape
verification (version big-endian, varint token length, retry token
+ integrity tag layout)
Wire the new translation unit into tests/CMakeLists.txt as
network_quic_packet_coverage_test.
Closes #10281 parent 4e148d2 commit ab8e997
2 files changed
Lines changed: 785 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3576 | 3576 | | |
3577 | 3577 | | |
3578 | 3578 | | |
| 3579 | + | |
| 3580 | + | |
| 3581 | + | |
| 3582 | + | |
| 3583 | + | |
| 3584 | + | |
| 3585 | + | |
| 3586 | + | |
| 3587 | + | |
| 3588 | + | |
| 3589 | + | |
| 3590 | + | |
| 3591 | + | |
| 3592 | + | |
| 3593 | + | |
| 3594 | + | |
| 3595 | + | |
| 3596 | + | |
| 3597 | + | |
| 3598 | + | |
| 3599 | + | |
| 3600 | + | |
| 3601 | + | |
| 3602 | + | |
| 3603 | + | |
| 3604 | + | |
| 3605 | + | |
| 3606 | + | |
| 3607 | + | |
| 3608 | + | |
| 3609 | + | |
| 3610 | + | |
| 3611 | + | |
3579 | 3612 | | |
3580 | 3613 | | |
3581 | 3614 | | |
| |||
0 commit comments