Skip to content

test(tools): add test coverage for nid_names - #1662

Closed
Amirtheshwaran wants to merge 1 commit into
boykopovar:mainfrom
Amirtheshwaran:test/nid-names
Closed

Amirtheshwaran wants to merge 1 commit into
boykopovar:mainfrom
Amirtheshwaran:test/nid-names

Conversation

@Amirtheshwaran

Copy link
Copy Markdown
Contributor

What

Add unit test coverage for tools/nid_names.py and register the test suite in CMakeLists.txt.

  • Add tools/tests/test_nid_names.py covering:
    • compute_nid: symbol hashing across known PS5 vectors, output length (11), and charset validation.
    • load_db: CSV database parsing, empty/short line handling, and fallback download execution.
    • collect_unknowns: discovery of APS5_EXPORT unknown aliases across PRX sources.
    • collect_real_names: discovery of APS5_VABI implementations and _nid_postfix stripping.
    • main: CLI handling across rename-ready (exit 0), already-implemented (exit 0), MISMATCH (exit 1), and --json serialization.
  • Allow main(argv=None) in tools/nid_names.py to receive custom argv for CLI testability.
  • Register nid_names in root CMakeLists.txt under BUILD_TESTING (touches the same test registration block as test(tools): add test coverage for check_test_registration #1623).

Tested

Windows 11, Python 3.11:

  • python -m unittest discover -s tools/tests -v: 23 tests pass in 1.2s (including all 9 NidNamesTests test cases).
  • python tools/check_conventions.py --base origin/main: passed (All conventions checks passed.).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#1741 CMakeLists.txt L43

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Same as #1623: test coverage for nid_names.py with nothing broken behind it, so closing. #1328 fixes a real bug in the same tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants