tests: fix the DirectStorage file read check build on MSVC 19.42 #1589
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!1589
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1589/head"
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?
@SimSalabimse on GitHub · 2026-11-24 14:39 UTC · original
SimSalabimse:x2w-dstorage-c2664→main· +1 −1 · 1 files · 1 commits · merged 2026-11-24 14:47 UTCChange
tests/startup_dstorage_file_read_check.cpp:102(added in #1493) does not compile on MSVC 19.42. The conditionalalias ? low_alias.bytes : above_4g.bytesdecays toconst unsigned char *, andread()takesconst unsigned char (&)[4]:The call now selects a pointer to the array and dereferences it, so the reference binds to the chosen
unsigned char[4]. Test behaviour is unchanged.Verification
Windows 11 26200, MSVC 19.42.34435 (VS 2022).
Before:
cmake --build --preset devexited 1 with the C2664 above.After:
cmake --build --preset dev: exit 0cmake --preset releaseandcmake --build --preset release: exit 0ctest --preset dev --no-tests=error -R "dstorage" --output-on-failure: exit 0ctest --preset release --no-tests=error -R "dstorage" --output-on-failure: exit 0AI-assisted (Grok Build)
@tedin7 on GitHub · 2026-11-24 14:50 UTC · original · reviewed
Reviewed commit
79f41db81c0cb30895e91d4bca1f8e1237f112d6(tests: fix the DirectStorage file read check build on MSVC 19.42). No defects found.Technical review
tests/startup_dstorage_file_read_check.cpp: Replacesalias ? low_alias.bytes : above_4g.byteswith*(alias ? &low_alias.bytes : &above_4g.bytes), avoiding array-to-pointer decay in the ternary expression so the result remainsconst unsigned char (&)[4]forread(...).Verification
python3 tests/docs_links_check.py— passed (16 Markdown files, 344 links).python3 tests/bidi_controls_check.py— passed (1254 files).--preset dev,startup_dstorage_file_read_check): 2/2 passed (startup_dstorage_file_read0.01s,startup_dstorage_file_read_alias_control0.01s)./O2(--preset release,startup_dstorage_file_read_check): 2/2 passed (startup_dstorage_file_read0.01s,startup_dstorage_file_read_alias_control0.01s).AI-assisted; commands listed were executed locally.