tests: cover x2w_console_mode helpers, boundaries, and status codes #3743

Manually merged
github merged 1 commit from github-bot/gh-3741 into main 2026-12-01 17:11:26 +00:00 AGit
Owner

@⁠Ammmae0x on GitHub · 2026-12-01 13:50 UTC · original
Ammmae0x:tests/console-mode-unit → main · +1388 −0 · 5 files · 1 commits · merged 2026-12-01 17:07 UTC

Refs #1149

Portable C++17 unit and header-mutation tests for src/startup_stubs/console_mode.h: 47 cases covering fold (uppercase endpoints and neighbours, lowercase, other characters), equal_ci (exact, mixed case, nullptrs, prefix vs exact length mismatches, empty strings), is_oem_subkey (canonical mixed-case subkey, one optional leading or trailing backslash, double backslashes, nullptr, shorter and longer rejections), is_console_mode_value, answer_for (unset passes through, 1 is missing, 6 is 0x60, 7 is 0x64, other types pass through, null mode pointer never dereferenced), fill_query (status_invalid without a size pointer, null data pointer, short buffer status_more_data without touching data, exact and larger buffers serialize little-endian, null type pointer), fill_get (flags without rrf_rt_reg_dword are status_wrong_type without touching output, exact and compound flags accepted), and the status, type and series constants. Six WILL_FAIL TRUE copy mutations of the header, each killed by its control case. Zero edits to existing files (5 new files only); test names use the console_mode_unit prefix so they stay disjoint from the Windows-only startup_console_mode check. No mingw on this host, so no Windows compile check; WIN-VERIFY run is the arbiter.

Linux checks (this host, g++ -std=c++17):

python3 -B tests/console_mode_unit_meta_check.py
PASS: console_mode_unit: 47 cases, 6/6 mutations killed (g++)
/tmp/pe-env/bin/python -B tests/form_coverage_check.py
form coverage checks passed
/tmp/pe-env/bin/python -B tests/docs_links_check.py
Checked 208 Markdown files and 802 links.
/tmp/pe-env/bin/python -B tests/bidi_controls_check.py
Checked 2826 tracked source, script and build/CI files: no bidirectional controls.
git diff --check clean; git merge-tree --write-tree origin/main HEAD exits 0
scratch CMake + CTest: 54/54 passed (47 per-case + console_mode_unit_all + 6 WILL_FAIL controls)

AI-assisted.

Windows Verification (acfe97b0)

  • git merge-tree --write-tree upstream/main HEAD -> 4e7d70af (exit 0), git diff --check clean
  • Python checks: py_compile, form_coverage_check.py, docs_links_check.py (209 files, 806 links), bidi_controls_check.py (2829 files) passed
  • Commands:
cmake --build --preset dev --target console_mode_unit_check console_mode_unit_fold_z_mut console_mode_unit_answer_missing_mut console_mode_unit_answer_series_s_mut console_mode_unit_fill_query_invalid_mut console_mode_unit_fill_query_short_mut console_mode_unit_fill_get_flag_mut
ctest --preset dev --no-tests=error -R "^console_mode_unit" --output-on-failure
cmake --build --preset release --target console_mode_unit_check console_mode_unit_fold_z_mut console_mode_unit_answer_missing_mut console_mode_unit_answer_series_s_mut console_mode_unit_fill_query_invalid_mut console_mode_unit_fill_query_short_mut console_mode_unit_fill_get_flag_mut
ctest --preset release --no-tests=error -R "^console_mode_unit" --output-on-failure
  • Results: dev 54/54 passed (1.44s); release 54/54 passed (1.20s); console_mode_unit_check: PASS: console_mode_unit: 47/47 cases passed. AI-assisted.
**@⁠Ammmae0x** on GitHub · 2026-12-01 13:50 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3741) `Ammmae0x:tests/console-mode-unit` → `main` · +1388 −0 · 5 files · 1 commits · merged 2026-12-01 17:07 UTC Refs #1149 Portable C++17 unit and header-mutation tests for `src/startup_stubs/console_mode.h`: 47 cases covering `fold` (uppercase endpoints and neighbours, lowercase, other characters), `equal_ci` (exact, mixed case, nullptrs, prefix vs exact length mismatches, empty strings), `is_oem_subkey` (canonical mixed-case subkey, one optional leading or trailing backslash, double backslashes, nullptr, shorter and longer rejections), `is_console_mode_value`, `answer_for` (unset passes through, 1 is missing, 6 is 0x60, 7 is 0x64, other types pass through, null mode pointer never dereferenced), `fill_query` (status_invalid without a size pointer, null data pointer, short buffer status_more_data without touching data, exact and larger buffers serialize little-endian, null type pointer), `fill_get` (flags without `rrf_rt_reg_dword` are status_wrong_type without touching output, exact and compound flags accepted), and the status, type and series constants. Six `WILL_FAIL TRUE` copy mutations of the header, each killed by its control case. Zero edits to existing files (5 new files only); test names use the `console_mode_unit` prefix so they stay disjoint from the Windows-only `startup_console_mode` check. No mingw on this host, so no Windows compile check; WIN-VERIFY run is the arbiter. Linux checks (this host, `g++ -std=c++17`): ```text python3 -B tests/console_mode_unit_meta_check.py PASS: console_mode_unit: 47 cases, 6/6 mutations killed (g++) /tmp/pe-env/bin/python -B tests/form_coverage_check.py form coverage checks passed /tmp/pe-env/bin/python -B tests/docs_links_check.py Checked 208 Markdown files and 802 links. /tmp/pe-env/bin/python -B tests/bidi_controls_check.py Checked 2826 tracked source, script and build/CI files: no bidirectional controls. git diff --check clean; git merge-tree --write-tree origin/main HEAD exits 0 scratch CMake + CTest: 54/54 passed (47 per-case + console_mode_unit_all + 6 WILL_FAIL controls) ``` AI-assisted. <!-- WIN-VERIFY: passed | sha=acfe97b0c7ed5582bb15b17f9ced297514734c6a | targets=console_mode_unit_check console_mode_unit_fold_z_mut console_mode_unit_answer_missing_mut console_mode_unit_answer_series_s_mut console_mode_unit_fill_query_invalid_mut console_mode_unit_fill_query_short_mut console_mode_unit_fill_get_flag_mut | ctest=^console_mode_unit | release=true --> ### Windows Verification (`acfe97b0`) - `git merge-tree --write-tree upstream/main HEAD` -> `4e7d70af` (exit 0), `git diff --check` clean - Python checks: `py_compile`, `form_coverage_check.py`, `docs_links_check.py` (209 files, 806 links), `bidi_controls_check.py` (2829 files) passed - Commands: ```text cmake --build --preset dev --target console_mode_unit_check console_mode_unit_fold_z_mut console_mode_unit_answer_missing_mut console_mode_unit_answer_series_s_mut console_mode_unit_fill_query_invalid_mut console_mode_unit_fill_query_short_mut console_mode_unit_fill_get_flag_mut ctest --preset dev --no-tests=error -R "^console_mode_unit" --output-on-failure cmake --build --preset release --target console_mode_unit_check console_mode_unit_fold_z_mut console_mode_unit_answer_missing_mut console_mode_unit_answer_series_s_mut console_mode_unit_fill_query_invalid_mut console_mode_unit_fill_query_short_mut console_mode_unit_fill_get_flag_mut ctest --preset release --no-tests=error -R "^console_mode_unit" --output-on-failure ``` - Results: `dev` 54/54 passed (1.44s); `release` 54/54 passed (1.20s); `console_mode_unit_check`: `PASS: console_mode_unit: 47/47 cases passed`. AI-assisted.
Refs #1149

Portable C++17 unit and header-mutation tests for src/startup_stubs/console_mode.h: 47 cases covering fold (uppercase endpoints and neighbours, lowercase, other characters), equal_ci (exact, mixed case, nullptrs, prefix vs exact length mismatches, empty strings), is_oem_subkey (canonical mixed-case subkey, one optional leading or trailing backslash, double backslashes, nullptr, shorter and longer rejections), is_console_mode_value, answer_for (unset passes through, 1 is missing, 6 is 0x60, 7 is 0x64, other types pass through, null mode pointer never dereferenced), fill_query (status_invalid without a size pointer, null data pointer, short buffer status_more_data without touching data, exact and larger buffers serialize little-endian, null type pointer), fill_get (flags without rrf_rt_reg_dword are status_wrong_type without touching output, exact and compound flags accepted), and the status, type and series constants. Six WILL_FAIL TRUE copy mutations of the header, each killed by its control case.

AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 13:54:54 +00:00
github manually merged commit 92c083dc73 into main 2026-12-01 17:11:26 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.