tests: cover x2w_runtime_patch PE import and delay-load walkers #3751
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3751
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3749"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Ammmae0x on GitHub · 2026-12-01 14:55 UTC · original
Ammmae0x:tests/runtime-gpa-patch-unit→main· +1502 −0 · 5 files · 2 commits · merged 2026-12-01 17:04 UTCRefs #1149
Portable C++17 unit, malformed-PE boundary, and 1:1 header-mutation tests for
x2w_runtime_patch(src/startup_stubs/runtime_gpa_patch.h), with zero edits to existing files (5 new files only). The existingtests/startup_runtime_gpa_patch_check.cppcoverage is untouched, and the new check uses the disjointruntime_gpa_patch_unitprefix so test names do not collide.tests/runtime_gpa_patch_unit_check.cpp: 33 cases, pure C++17, no<windows.h>.dll_is_xgameruntime(exact lower, mixed and upper case, null, empty, a short prefix, an extra suffix); the case-sensitive import names andclassify(GetProcAddressfrom any DLL,QueryApiImplonly fromxgameruntime.dll, rejections leavingkindunchanged);readable_range(null base, zero bytes, an RVA past the image, the overflow guard, the exact end) andc_string_in_image(a NUL at the last byte, an unterminated string); the packed struct layout (DosStub64 bytes withe_lfanewat 60,ImportDesc20,DelayDesc32); andvisit_imports/visit_imports_withover synthetic PE32+ byte buffers (regular imports with exact kind / first-thunk RVA / DLL / import name, delay imports flaggeddelay_import, an ordinal thunk skipped while later named thunks are still visited, bad DOS magic, a negativee_lfanew, a bad PE signature, PE32 rejected, truncated headers, a sparse null-name descriptor skipped, an unterminated hint string skipped, a custom classifier returningKind::registry, null and empty images, an all-zero descriptor terminating the walk, and zero-size import/delay directories). Buffers are written byte by byte, with noreinterpret_castof image data.tests/cmake/runtime_gpa_patch_unit.cmake: per-case CTests plusruntime_gpa_patch_unit_alland 6WILL_FAIL TRUEheader-copy controls (dll_suffix,query_gate,pe32_magic,ordinal_skip,delay_flag,readable_range) with mutated copies understartup_stubs/runtime_gpa_patch.handBEFORE PRIVATEinclude.tests/runtime_gpa_patch_unit_meta_check.py,tests/checks/python-linux/runtime_gpa_patch_unit.txt,docs/experiments/runtime-gpa-patch-unit.md.Linux checks (this host,
g++ -std=c++17):Scratch CMake + CTest: 40/40 (33 cases,
runtime_gpa_patch_unit_all, 6 mutation controls). Form, docs (208 files / 802 links), and bidi (2827 files) checks pass; parallel Python runner 299/299;diff --checkclean; merge-tree vsorigin/mainexits 0.No mingw on this host, so no Windows compile check; WIN-VERIFY run is the arbiter.
AI-assisted.
Windows Verification (
ee993a26)git merge-tree --write-tree upstream/main HEAD->86e6561d(exit 0),git diff --check upstream/main...HEADcleanpy_compile,form_coverage_check.py,docs_links_check.py(209 files, 806 links),bidi_controls_check.py(2830 files) passeddev40/40 passed (0.95s);release40/40 passed (0.90s); directruntime_gpa_patch_unit_check.exe(dev&release):PASS: runtime_gpa_patch_unit: 33/33 cases passed. AI-assisted.