test: test_native_astc_texture_count builds on Windows, where the CRT marks scanf deprecated #2397
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2397
Loading…
Reference in a new issue
No description provided.
Delete branch "test/native-astc-count-windows"
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?
What this is for: main's game-free checks pass on Windows again. The test that came with my #2288 does not compile there, so
Python source checks (windows-2022, part 1/2)fails on every run since that merge. What is measured: the test with g++ and clang++ on Linux, on this branch. Not measured: Windows on my side: I have no Windows machine, so this pull request's own windows-2022 job is the proof, and I will confirm its result here.Problem
tests/test_native_astc_texture_count.pycompiles a small fixture with-Wall -Wextra -Werrorand reads its cases withstd::scanf. With clang and the Windows CRT's headersscanfis marked deprecated, which-Werrormakes an error:What changed
tests/test_native_astc_texture_count.py: the fixture defines_CRT_SECURE_NO_WARNINGSahead of its includes, as the other test sources that use these functions do (tests/capture_dimensions_test.cpp,tests/png_publication_test.cppand others). One line; no assertion, case or source file changes.How it was tested
Arch Linux, g++ 16.2.1 and clang++ 23.1.3, branch head
fc0157a1on main696d85b0:python -I -B tests/test_native_astc_texture_count.py --cxx g++and--cxx clang++:native ASTC texture count: 182 cases pass, as before the change.Not tested
Risks
Fixes #2396.
Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 [email protected]
Looks good. One line added to the fixture, no assertion, case or source change, so the test is not weakened (182 cases still run). The define sits before the includes, the same way
tests/test_slow_frame_limit.pydoes it in its inline fixture and the.cpptests (png_publication_test.cpp,capture_dimensions_test.cpp, ...).Python source checks (windows-2022, part 1/2)now passes on this head, which is the proof the description asked for. Theappimagefailure is in theSystem packagesstep, unrelated to a test-only change. Part 2/2 and the Linux jobs were still pending when I looked.Thanks for the review. Confirmed from this head’s Windows part 1/2 log:
tests/test_native_astc_texture_count.pypasses, and the shard ends with179 passed, 0 failed, 15 skipped. That verifies the Windows CRT compile fix onfc0157a1, which was still untested when I opened this PR. No game code changes.Testing pass on
mainat497060f9(this PR plus everything merged up to #2223):2ed98c46until this PR, the Windows part on each push tomainfailed on this test alone: clang on the MSVC headers stopped onscanfunder-Werror.tests/run_all.py, with the Vulkan and SPIR-V headers and the glslang 16.6.0 that CI pins. 400 passed, 0 failed, 11 skipped. The skips are Windows-only checks (6), checks that need a game dump or a game build (4), and one that needs a Vulkan device.github-sync referenced this pull request2026-11-12 06:22:54 +00:00