test_undeclared_accessor_families_sees_MACRO_defined_accessors

Tests › tests/test_build_docs_db.py

passed Passed in the packaged run.

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

  1. db_path = tmp_path / "clew.db"
  2. conn = sqlite3.connect(str(db_path))
4 more
  1. 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 ); """, )
  2. conn.execute("INSERT INTO path (rowid, name) VALUES (1, 'src/store.h')")
  3. 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"), ], )
  4. conn.commit()
→

When

  1. fams = {f.prefix: f.keys for f in detect_undeclared_accessor_families(conn, [])}
  2. conn.close()
→

Then

  1. ✓ fams.get("Store_Set_") equals 5

tests/test_build_docs_db.py:1623 · its file's page

What it checks (1)

  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}" ) observes detect_undeclared_accessor_families via fams

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

test_undeclared_accessor_families_sees_MACRO_defined_accessors→detect_undeclared_accessor_families

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.

test_undeclared_accessor_families_sees_MACRO_defined_accessors · 1 checksdetect_undeclared_accessor_familiesREQ-DDB-CONFIG-007 · measureddetect_undeclared_accessor_familiesREQ-DDB-SCHEMA-005 · measured

Requirements it verifies (2)

requirementlinked byimplementers exercised
REQ-DDB-PIPE-001catalogunknown
REQ-DDB-PIPE-010catalogunknown
Also reaches 2 requirements

Its run touches their code; that is reach, not proof.