test_the_decl_def_duality_still_elects_the_definition¶
Tests › tests/test_outofline_definitions.py
What this test is for
Why it exists
THE REGRESSION THIS PINS. Widening the definition test to "carries a body" made it TRUE for BOTH rows of a duality pair, so the `rowid` tiebreak elected the header DECLARATION — which doxygen emits first. Measured on mbedtls before this test existed: 37 multi-row names flipped their resolved rowid, and `resolve_symbol` joins `path` on `file_id` while taking `bodystart`, so the elected row published a HEADER path with the .c's body line — a fabricated file:line an agent would go read.
Given
conn = _duality_fixture(tmp_path)
When
try: got = _common.resolve_rowid(conn, "u128_eq") rows = _common.function_candidates(conn, "u128_eq") finally: conn.close()
Then
- ✓ got equals DUAL_DEF
- ✓ rows[0][0] equals DUAL_DEF
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 · 6 of 226 steps
… 45 earlier steps
… 155 steps between
… 11 later steps
1 more
- Build this wiki from the index · 4 of 400 steps
tests/test_outofline_definitions.py:224 · its file's page
What it checks (2)
assert got == DUAL_DEF, ( f"resolved to rowid {got}; the header DECLARATION row was elected over the definition " f"because both carry the same body span and the tiebreak is rowid ascending" )observesresolve_rowidviagotassert rows[0][0] == DUAL_DEF, ( f"candidates ranked the declaration first: {rows}. `resolve_symbol` joins path on " f"file_id but takes bodystart, so this publishes a header path with the .c's line" )observesfunction_candidatesviarows
Where the product reaches it
Call flow
test_the_decl_def_duality_still_elects_the_definition→_duality_fixture→resolve_rowid→function_candidatesWhat 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.
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-010 measured