diff options
| author | Rafael <rafaelalvesp2005@gmail.com> | 2026-11-22 13:19:36 -0300 |
|---|---|---|
| committer | Rafael <rafaelalvesp2005@gmail.com> | 2026-11-22 13:19:36 -0300 |
| commit | c950b735e49b1da295c216eacef27b021f2f1a2e (patch) | |
| tree | 11f18b8bad3bf245b16f3263cc05ed63fdf4cfe5 /runtime/test/gameinput_test.cpp | |
| parent | 4eb6155d3ac4f9d3fadb0d095c4ce13e76783615 (diff) | |
gamedata_xml: count the comments of a document the parser cannot finish
Since 93211578 comments are counted from iterparse "comment" events, which is right for a well-formed
document (comment-like text in CDATA is not a comment). But a truncated or tail-only document stops the
parser at the error, and the comments after it were never counted. When parsing fails, the comment starts
are now counted in the bytes, skipping CDATA sections (an unclosed one runs to the end).
Real data (counts only), the common.rpf carve: --check reports 507 comment starts (412 in 257
declaration-bearing documents), as docs/gamedata.md:471 says; main reported 412 (412). The 95 missing
ones were in 2 truncated tail-only documents.
Tests: test_comments_in_a_document_that_does_not_parse_are_counted (unclosed root, tail-only document,
CDATA closed and cut off; main: the tail-only case gives 0).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/gameinput_test.cpp')
0 files changed, 0 insertions, 0 deletions