test_resolve_symbol_flags_genuine_overload¶
Tests › tests/test_query.py
What this test is for
Why it exists
A name mapping to distinct signatures (different classes) is a genuine overload: resolve_symbol still returns a definition-preferring primary but exposes every alternative so a consumer can pick the right one by file, rather than silently tracing an arbitrary overload.
Verifies REQ-DDB-QUERY-002
Given
db = _overload_db( tmp_path, [ (10, "react", "void A::react", "src/a.cpp", True), (11, "react", "void B::react", "src/b.cpp", True), (12, "react", "void C::react", "include/c.hpp", False), ], )
When
ref = q.resolve_symbol(db, "react")sigs = {c.signature for c in ref.candidates}files = {c.file for c in ref.candidates}
Then
- ✓ ref is not None
- ✓ ref.rowid equals 10
- ✓ sigs equals {"void A::react", "void B::react", "void C::react"}
- ✓ files equals {"src/a.cpp", "src/b.cpp", "include/c.hpp"}
- ✓ any(c.file.endswith("c.hpp") and c.has_body is False for c in ref.candidates) holds
What it exercises
The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.
Look up one name: everything the index holds about it · 10 of 226 steps
… 17 earlier steps
… 23 steps between
… 24 steps between
… 105 steps between
… 31 later steps
3 more
- Build this wiki from the index · 4 of 400 steps
- clew — `main` (clew/cli.py) · 3 of 400 steps
- `main` (scripts/export_parity.py) · 3 of 203 steps
tests/test_query.py:651 · its file's page
What it checks (5)
assert ref is not Noneobservesresolve_symbolviarefassert ref.rowid == 10observesresolve_symbolviarefassert sigs == {"void A::react", "void B::react", "void C::react"}not attributedassert files == {"src/a.cpp", "src/b.cpp", "include/c.hpp"}not attributedassert any(c.file.endswith("c.hpp") and c.has_body is False for c in ref.candidates)observesresolve_symbolviaref
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
Call flow
What it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.
Requirements it verifies (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-QUERY-002 | catalog | unknown |
Also reaches 4 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-INDEX-004 measured
- REQ-DDB-QUERY-001 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-010 measured