1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-10-01 08:44:05 +02:00
parser/tests
Peter 7c5c596d17 Use the demo's protocol version when reencoding
DemoHandler::default() starts out at protocol 24 and relies on handle_header
to replace that with whatever the demo actually is. Parsing through DemoParser
does this for you, but reencode drives the handler itself and never did, so
every demo got read as protocol 24.

Older protocols put a few fields at different widths, so the message stream
desyncs partway in. RawPacketStream reports that as a truncated demo rather
than an error, which is why nothing complains about it: reencode_demo on
test_data/protocol23.dem writes 1076 bytes, prints a truncation warning and
still exits 0.

The reencode test missed this because protocol23.dem was never in its list,
and because nothing checked the demo had been read to the end. Add a test for
that and the same assert to the existing round trip.

Output for protocol 24 demos is unchanged, byte for byte.
2026-08-31 11:14:15 +01:00
..
snapshots store last medic target 2025-08-07 23:22:35 +02:00
entity.rs clippy fixes 2025-07-13 23:40:28 +02:00
message_reencode.rs feature gate write support, use hash to compare game event definitions 2025-07-15 16:06:23 +02:00
reencode.rs Use the demo's protocol version when reencoding 2026-08-31 11:14:15 +01:00
sendprops.rs clippy fixes 2025-07-13 23:40:28 +02:00
stringtable.rs feature gate write support, use hash to compare game event definitions 2025-07-15 16:06:23 +02:00
tests.rs clippy fixes 2025-07-13 23:40:28 +02:00