test_external_boundary_records_forwarded_dead_end¶
Tests › tests/test_r1_richness.py
What this test is for
Why it exists
`my_cb = eventCb;` inside register_cb(param eventCb); the only in-repo caller forwards its OWN param out of repo → the callback dead-ends externally and my_cb is invoked in-repo → a terminus row (with the registering fn + param index), NOT a dropped edge.
Verifies REQ-DDB-SCHEMA-001 REQ-DDB-SCHEMA-002 REQ-DDB-SCHEMA-004
Given
src = tmp_path / "src"src.mkdir()
2 more
(src / "foo.c").write_text( "static Cb_t my_cb = 0;\n" "void register_cb(int x, Cb_t eventCb) {\n" " (void)x;\n" " my_cb = eventCb;\n" "}\n" "void invoke_cb(int e) {\n" " my_cb(e);\n" "}\n" "void app_layer(Cb_t appCb) {\n" " register_cb(0, appCb);\n" "}\n", )db = _make_db( tmp_path, [ (1, "register_cb", 2, 5), (2, "invoke_cb", 6, 8), (3, "app_layer", 9, 11), ], call_edges=[], )
When
import_callback_registration_edges(db, tmp_path)conn = sqlite3.connect(str(db))rows = conn.execute( "SELECT memberdef_rowid, global_name, kind, registered_by_rowid, " "registered_param_index, confidence FROM external_boundaries", ).fetchall()conn.close()
Then
- ✓ rows equals [(2, "my_cb", "unresolved_callback", 1, 1, "high")]
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.
clew — `main` (clew/cli.py) · 7 of 400 steps
… 70 earlier steps
… 313 later steps
tests/test_r1_richness.py:600 · its file's page
What it checks (1)
assert rows == [(2, "my_cb", "unresolved_callback", 1, 1, "high")]not attributed
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 (3)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-SCHEMA-001 | catalog | unknown |
| REQ-DDB-SCHEMA-002 | catalog | unknown |
| REQ-DDB-SCHEMA-004 | catalog | unknown |
Also reaches 8 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-004 inferred
- REQ-DDB-PIPE-003 measured
- REQ-DDB-PIPE-011 measured
- REQ-DDB-PIPE-012 inferred
- REQ-DDB-SCHEMA-003 measured
- REQ-DDB-SCHEMA-007 measured
- REQ-DDB-SCHEMA-012 measured
- REQ-DDB-WIKI-054 inferred