tests: cover x2w_api_trace contract table, decide partial outcomes, and formatting #3753
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!3753
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3751"
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 15:22 UTC · original
Ammmae0x:tests/api-trace-unit→main· +1539 −0 · 5 files · 1 commits · merged 2026-12-01 17:04 UTCRefs #1149.
Adds standalone, strict C++17 portable unit + 1:1 header-mutation tests for
x2w_api_trace(src/startup_stubs/api_trace.h), with zero edits to existing files (5 new files only, +1539/-0).tests/api_trace_check.cppandCMakeLists.txtare untouched; theapi_trace_unitprefix keeps all CMake/CTest/target names disjoint fromapi_trace.What is covered (27 cases, each callable via
--case <name>/<name>, no-arg runs all):declared(): all 15 contracts in the table (exact arg indices,first_bytes,size_argument,second,second_bytes), unknown provider, unknown slot, cross-provider slot mismatch (nullptr).decide():nullptrcontract (Outcome::Unknown); all outputscompared=falseorbytes=0(Outcome::Unreadable,partial=true); 1-outputSame&Changed; 2-outputSame, first-only changed, second-only changed, both changed; partial cases (Samewithpartial=true,Changedwithpartial=true,bytes[i]=0skipped even when buffer bytes differ); diff at last byte ofmax_snapshot(64).format():"?","unreadable","same","same,partial","changed:<arg>"(including argument index0for{0x37e56907, 15}),"changed:<arg>,partial","changed:<a0>,<a1>","changed:<a0>,<a1>,partial", exact slot-to-argument mapping for all 15 contracts, fallback with null contract ("changed:0","changed:-1"), small output buffer truncation.Mutation controls (6,
WILL_FAIL TRUEintests/cmake/api_trace_unit.cmake, mirrored 1:1 by real copied headers intests/api_trace_unit_meta_check.py):unreadable_same,partial_flag,zero_bytes_skip,second_arg_map,slot_lookup,format_partial_suffix.Verification (Linux, this host):
g++ -std=c++17 -O2 -Wall -Wextra -Wpedantic -Werror -Isrc tests/api_trace_unit_check.cpp:PASS: api_trace_unit: 27/27 cases passed/tmp/pe-env/bin/python -B tests/api_trace_unit_meta_check.py:PASS: api_trace_unit: 27 cases, 6/6 mutations killed (g++)dxc, unavailable on Linux):100% tests passed, 0 tests failed out of 34(27 cases +_all+ 6WILL_FAILmutation controls)tests/form_coverage_check.py,tests/docs_links_check.py(208 files / 802 links),tests/bidi_controls_check.py(2827 files) pass;git diff --checkclean; merge-tree vsorigin/mainexits 0; zero personal paths.python-linuxsuite (tools/run_checks_parallel.pywith the CI inline list +--from-dir tests/checks/python-linux):all 299 checks passedCaught in development: the
slot_lookupmutant left theproviderparameter unused, tripping-Werror=unused-parameterwhen compiling the mutated header, so the replacement keeps it via(void)provider,; and a known-size small buffer made-Wformat-truncationreject the header's ownsnprintfat the truncation call site, soformat_small_buffer_truncationuses 48-byte buffers with a smaller (volatile-held) size passed toformat().Caveat: no mingw on this host, so no Windows compile check; WIN-VERIFY run is the arbiter.
Windows Verification (
70e1ea76)git merge-tree --write-tree upstream/main HEAD->9bb5ed15(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) passeddev34/34 passed (0.98s);release34/34 passed (0.77s); directapi_trace_unit_check.exe(dev&release):PASS: api_trace_unit: 27/27 cases passed. AI-assisted.