tests: cover AddressIndex range groups, overflow clamps, and rollbacks #3749

Manually merged
github merged 1 commit from github-bot/gh-3747 into main 2026-12-01 17:05:19 +00:00 AGit
Owner

@⁠Ammmae0x on GitHub · 2026-12-01 14:47 UTC · original
Ammmae0x:tests/resource-address-index-unit → main · +1245 −0 · 5 files · 1 commits · merged 2026-12-01 17:04 UTC

Refs #1149.

Portable C++17 unit, boundary, exception-safety, and 1:1 header-mutation tests for x2w_startup::AddressIndex, address_span_touches, and store_indexed (src/startup_stubs/resource_address_index.h), with zero edits to existing files (5 new files only, +1245/-0). The existing tests/startup_resource_address_index_check.cpp coverage is untouched, and the new check uses the disjoint resource_address_index_unit prefix so test names stay disjoint.

23 cases: the span-touch predicate (null base never touches, unknown-size resources touch only at their base, both span-end edges), insert/erase (duplicate no-ops, extent upgrades across the 64 KiB group boundary in both directions, same-group extent replacement, exact-pair erasure), for_each_reaching (forward [from, to) edges, entries before from spanning from, entries ending exactly at from, the backward scan finding an older larger entry behind a shorter one in both the small and the large group, the max_extent cutoff, the UINT64_MAX overflow clamp, early stop, several keys at one base), and store_indexed (base 0 writes the record without indexing, a throwing record insert rolls the index back for a new key while leaving a known key indexed).

CMake registers one CTest test per case plus resource_address_index_unit_all, and 6 WILL_FAIL TRUE header-copy controls (null_base, span_end, max_extent, backward_extent, overflow_clamp, rollback), each killed by its pinned control case.

Linux checks (this host, g++ 13):

  • Meta check: PASS: resource_address_index_unit: 23 cases, 6/6 mutations killed (g++)
  • Scratch CMake + CTest: 30/30 (23 per-case + _all + 6 WILL_FAIL controls)
  • Form, docs (208 files / 802 links), and bidi (2827 files) checks pass; diff --check clean; merge-tree vs origin/main exits 0; zero personal paths
  • Full parallel Python suite: all 299 checks passed

No mingw on this host, so no Windows compile check; WIN-VERIFY run is the arbiter.

AI-assisted.

Windows Verification (f3162114)

  • git merge-tree --write-tree upstream/main HEAD -> 0834f8d7 (exit 0), git diff --check upstream/main...HEAD clean
  • Repo checks: py_compile, form_coverage_check.py, docs_links_check.py (209 files, 806 links), bidi_controls_check.py (2830 files) passed
  • Commands:
cmake --build --preset dev --target resource_address_index_unit_check resource_address_index_unit_null_base_mut resource_address_index_unit_span_end_mut resource_address_index_unit_max_extent_mut resource_address_index_unit_backward_extent_mut resource_address_index_unit_overflow_clamp_mut resource_address_index_unit_rollback_mut
ctest --preset dev --no-tests=error -j16 -R "^resource_address_index_unit" --output-on-failure
cmake --build --preset release --target resource_address_index_unit_check resource_address_index_unit_null_base_mut resource_address_index_unit_span_end_mut resource_address_index_unit_max_extent_mut resource_address_index_unit_backward_extent_mut resource_address_index_unit_overflow_clamp_mut resource_address_index_unit_rollback_mut
ctest --preset release --no-tests=error -j16 -R "^resource_address_index_unit" --output-on-failure
  • Results: dev 30/30 passed (1.03s); release 30/30 passed (0.88s); direct resource_address_index_unit_check.exe (dev & release): PASS: resource_address_index_unit: 23/23 cases passed. AI-assisted.
**@⁠Ammmae0x** on GitHub · 2026-12-01 14:47 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3747) `Ammmae0x:tests/resource-address-index-unit` → `main` · +1245 −0 · 5 files · 1 commits · merged 2026-12-01 17:04 UTC Refs #1149. Portable C++17 unit, boundary, exception-safety, and 1:1 header-mutation tests for `x2w_startup::AddressIndex`, `address_span_touches`, and `store_indexed` (`src/startup_stubs/resource_address_index.h`), with zero edits to existing files (5 new files only, +1245/-0). The existing `tests/startup_resource_address_index_check.cpp` coverage is untouched, and the new check uses the disjoint `resource_address_index_unit` prefix so test names stay disjoint. 23 cases: the span-touch predicate (null base never touches, unknown-size resources touch only at their base, both span-end edges), insert/erase (duplicate no-ops, extent upgrades across the 64 KiB group boundary in both directions, same-group extent replacement, exact-pair erasure), `for_each_reaching` (forward [from, to) edges, entries before `from` spanning `from`, entries ending exactly at `from`, the backward scan finding an older larger entry behind a shorter one in both the small and the large group, the `max_extent` cutoff, the UINT64_MAX overflow clamp, early stop, several keys at one base), and `store_indexed` (base 0 writes the record without indexing, a throwing record insert rolls the index back for a new key while leaving a known key indexed). CMake registers one CTest test per case plus `resource_address_index_unit_all`, and 6 `WILL_FAIL TRUE` header-copy controls (null_base, span_end, max_extent, backward_extent, overflow_clamp, rollback), each killed by its pinned control case. Linux checks (this host, g++ 13): - Meta check: `PASS: resource_address_index_unit: 23 cases, 6/6 mutations killed (g++)` - Scratch CMake + CTest: 30/30 (23 per-case + _all + 6 WILL_FAIL controls) - Form, docs (208 files / 802 links), and bidi (2827 files) checks pass; `diff --check` clean; merge-tree vs `origin/main` exits 0; zero personal paths - Full parallel Python suite: all 299 checks passed No mingw on this host, so no Windows compile check; WIN-VERIFY run is the arbiter. AI-assisted. <!-- WIN-VERIFY: passed | sha=f3162114ada86d88f1958de7da21006de504d36f | targets=resource_address_index_unit_check resource_address_index_unit_null_base_mut resource_address_index_unit_span_end_mut resource_address_index_unit_max_extent_mut resource_address_index_unit_backward_extent_mut resource_address_index_unit_overflow_clamp_mut resource_address_index_unit_rollback_mut | ctest=^resource_address_index_unit | release=true --> ### Windows Verification (`f3162114`) - `git merge-tree --write-tree upstream/main HEAD` -> `0834f8d7` (exit 0), `git diff --check upstream/main...HEAD` clean - Repo checks: `py_compile`, `form_coverage_check.py`, `docs_links_check.py` (209 files, 806 links), `bidi_controls_check.py` (2830 files) passed - Commands: ```text cmake --build --preset dev --target resource_address_index_unit_check resource_address_index_unit_null_base_mut resource_address_index_unit_span_end_mut resource_address_index_unit_max_extent_mut resource_address_index_unit_backward_extent_mut resource_address_index_unit_overflow_clamp_mut resource_address_index_unit_rollback_mut ctest --preset dev --no-tests=error -j16 -R "^resource_address_index_unit" --output-on-failure cmake --build --preset release --target resource_address_index_unit_check resource_address_index_unit_null_base_mut resource_address_index_unit_span_end_mut resource_address_index_unit_max_extent_mut resource_address_index_unit_backward_extent_mut resource_address_index_unit_overflow_clamp_mut resource_address_index_unit_rollback_mut ctest --preset release --no-tests=error -j16 -R "^resource_address_index_unit" --output-on-failure ``` - Results: `dev` 30/30 passed (1.03s); `release` 30/30 passed (0.88s); direct `resource_address_index_unit_check.exe` (`dev` & `release`): `PASS: resource_address_index_unit: 23/23 cases passed`. AI-assisted.
Refs #1149.

Portable C++17 unit, boundary, exception-safety, and 1:1
header-mutation tests for x2w_startup::AddressIndex,
address_span_touches, and store_indexed
(src/startup_stubs/resource_address_index.h), with zero edits to
existing files. 23 cases: the span-touch predicate (null base,
unknown-size resources, both span-end edges), insert/erase
(duplicate no-ops, 64 KiB group-boundary migration, same-group
extent replacement, exact-pair erasure), for_each_reaching (forward
edges, spanning entries, entries ending at from, older larger
entries behind shorter ones in both groups, max_extent cutoff,
UINT64_MAX overflow clamp, early stop, several keys at one base),
and store_indexed (base 0 without indexing, throwing-insert
rollback for a new key, known-key retention). CMake registers
per-case tests plus _all and 6 WILL_FAIL TRUE header-copy controls.

AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 14:48:37 +00:00
github manually merged commit 9ef0893d96 into main 2026-12-01 17:05:19 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.