tests: fix the DirectStorage file read check build on MSVC 19.42 #1582
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1589"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-24T14:39:04Z.
Change
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)
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T14:50:42Z.
Review: COMMENTED
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.