Skip to content

tests: cover native VM module fallback regressions#255

Draft
cursor[bot] wants to merge 3 commits into
next-gen-5from
cursor/missing-test-coverage-26bc
Draft

tests: cover native VM module fallback regressions#255
cursor[bot] wants to merge 3 commits into
next-gen-5from
cursor/missing-test-coverage-26bc

Conversation

@cursor

@cursor cursor Bot commented Jun 11, 2026

Copy link
Copy Markdown

Risky behavior now covered

  • Native VM logical fallback ordering for classic and project-native module names (qagame -> game -> server, cgame -> client, ui -> frontend, and reverse aliases).
  • Native vmMain argument packing for direct native VM calls, including zero-filled missing argument slots so zero/one-argument calls do not read stack garbage.

Test files added/updated

  • tests/unit/test_vm_native_module.c
  • CMakeLists.txt
  • tests/README.md

Why this materially reduces regression risk

  • Recent native-module compatibility fixes were documented and partially refactored, but the high-risk alias order and native call argument behavior were still embedded in vm.c without direct unit coverage.
  • The new tests exercise extracted production helpers deterministically without real native libraries, pk3s, or game data.

Validation

  • cmake -S . -B build-coverage-tests -DBUILD_TESTING=ON -DBUILD_UNIT_TESTS=ON
  • cmake --build build-coverage-tests --target unit_vm_native_module
  • ctest --test-dir build-coverage-tests -R unit_vm_native_module --output-on-failure
  • cmake --build build-coverage-tests --target idtech3_server
Open in Web View Automation 

cursoragent and others added 3 commits June 11, 2026 10:08
Co-authored-by: Tim Fox <timfox@outlook.com>
Co-authored-by: Tim Fox <timfox@outlook.com>
Co-authored-by: Tim Fox <timfox@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant