test_undeclared_accessor_families_sees_MACRO_defined_accessors¶
Tests › tests/test_build_docs_db.py
What this test is for
Why it exists
The diagnostic must read `kind='macro definition'`, not functions alone.
Verifies REQ-DDB-PIPE-001 REQ-DDB-PIPE-010
Given
db_path = tmp_path / "clew.db"conn = sqlite3.connect(str(db_path))
4 more
conn.executescript( """ CREATE TABLE path (name TEXT); CREATE TABLE memberdef ( rowid INTEGER PRIMARY KEY, kind TEXT, name TEXT, file_id INTEGER, bodyfile_id INTEGER, bodystart INTEGER, bodyend INTEGER ); """, )conn.execute("INSERT INTO path (rowid, name) VALUES (1, 'src/store.h')")conn.executemany( "INSERT INTO memberdef " "(rowid, kind, name, file_id, bodyfile_id, bodystart, bodyend) " "VALUES (?, 'macro definition', ?, 1, 1, 0, 0)", [ (1, "Store_Set_ALPHA"), (2, "Store_Set_BETA"), (3, "Store_Set_GAMMA"), (4, "Store_Set_DELTA"), (5, "Store_Set_EPSILON"), ], )conn.commit()
When
fams = {f.prefix: f.keys for f in detect_undeclared_accessor_families(conn, [])}conn.close()
Then
- ✓ fams.get("Store_Set_") equals 5
tests/test_build_docs_db.py:1623 · its file's page
What it checks (1)
assert fams.get("Store_Set_") == 5, ( "a macro-defined accessor family must be surfaced; the diagnostic read " f"only kind='function' and was structurally blind to it. got: {fams}" )observesdetect_undeclared_accessor_familiesviafams
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 (2)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-PIPE-001 | catalog | unknown |
| REQ-DDB-PIPE-010 | catalog | unknown |
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-SCHEMA-005 measured