tests: add unit and mutation tests for native_copy_ranges.h #3654
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3654"
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 Ammmae0x on 2026-11-30T21:45:03Z.
Refs #1149
Adds a portable C++17 unit, differential-fuzz, and configure-time header-mutation test suite for
x2w_startup::NativeCopyRanges(src/startup_stubs/native_copy_ranges.h, previously untested intests/). No existing file is modified;native_copy_ranges.hand device code are untouched.What landed (5 new files, +923/-0):
tests/startup_native_copy_ranges_check.cpp— standard C++17 only, no device or graphics API. Six cases (--caseselectable, loudFAIL: <case>:to stderr): empty/inverted ranges are no-ops, adjacent coalesce in both orders, one add bridging three spans, middle/multi-span splits and trims, coverage none/partial/full across exact edges, gaps, and the[UINT64_MAX-16, UINT64_MAX)endpoints, and a deterministic 1500-step splitmix64 differential fuzz against an independent reference model (strict span invariants checked at every step).tests/cmake/startup_native_copy_ranges.cmake— per-case plusstartup_native_copy_ranges_alltests, and sixWILL_FAIL TRUEmutation controls mirroringera_physical_owns_last_page_control, each a configure-time mutated header copy with a pinned control case.tests/startup_native_copy_ranges_meta_check.py+tests/checks/python-linux/startup_native_copy_ranges.txt— Linux contract audit that compiles and runs the real test and every mutated header copy natively withg++ -std=c++17.docs/experiments/startup-native-copy-ranges.md— cases, controls, and runs.Tests (Linux):
PASS: startup native copy ranges: 6 cases, 6/6 mutations killed (g++).form_coverage_check.py,docs_links_check.py(192 files/745 links),bidi_controls_check.py(2762 files) pass;diff --checkclean; zero personal paths.tools/run_checks_parallel.py --from-dir tests/checks/python-linux ...): all 282 checks passed.Windows execution (MSVC) awaits Windows verification:
Windows Verification (
6f1d84ea)AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-01T00:10:09Z.
Review: APPROVED
Reviewed the native copy-range fixtures and their six mutation controls.
ctest --test-dir <build> --no-tests=error -j1 -R '^startup_native_copy_ranges_' --output-on-failurepassed in the Windows Release integration.python -B tests/startup_native_copy_ranges_meta_check.pyindependently passed with all six mutations caught.