test_the_spawn_diagnostic_ignores_non_callable_symbols¶
Tests › tests/test_thread_spawns.py
What this test is for
Why it exists
MEASURED ON THREE BUILT INDEXES, not imagined. `detect_undeclared_spawn_primitives` read `SELECT DISTINCT name FROM memberdef` with NO kind filter, so every name in the database was a candidate and only `_spawn_shaped` adjacency stood between a constant and a hint:
Given
conn = sqlite3.connect(":memory:")conn.execute("CREATE TABLE memberdef (rowid INTEGER PRIMARY KEY, name TEXT, kind TEXT)")
2 more
conn.executemany( "INSERT INTO memberdef (name, kind) VALUES (?, ?)", [ ("sys_thread_create", "function"), ("SYSTEM_TASKCREATE", "macro definition"), ## The real false positive, verbatim from this repository's own index. ("_THREAD_SPAWNER_COLUMNS", "variable"), ("thread_create_fn_t", "typedef"), ("THREAD_CREATE_RESULT", "enumeration"), ], )conn.commit()
When
found = detect_undeclared_spawn_primitives(conn, load_thread_patterns(None))
Then
- ✓ found equals ["SYSTEM_TASKCREATE", "sys_thread_create"]
tests/test_thread_spawns.py:483 · its file's page
What it checks (1)
assert found == ["SYSTEM_TASKCREATE", "sys_thread_create"], ( f"a spawn primitive is callable — a function or a wrapper macro. Got {found}; a variable, " f"typedef or enumeration that merely NAMES threading is a constant, not a primitive an " f"operator can declare" )observesdetect_undeclared_spawn_primitivesviafound
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_the_spawn_diagnostic_ignores_non_callable_symbols→detect_undeclared_spawn_primitives→load_thread_patternsWhat 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 3 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-SCHEMA-001 measured
- REQ-DDB-SCHEMA-012 inferred