test_a_class_shows_its_bases_and_derived¶
Tests › tests/test_wiki_apiref.py
What this test is for
Why it exists
ENTROPIC'S GAP 3: no inheritance. From the index's `compoundref`: a class lists what it inherits from and what derives from it.
Given
conn = sqlite3.connect(":memory:")conn.executescript( "CREATE TABLE path (rowid INTEGER PRIMARY KEY, name TEXT, type INT, found INT);" "CREATE TABLE compounddef (rowid INTEGER PRIMARY KEY, name TEXT, kind TEXT, prot INT," " file_id INT, line INT, briefdescription TEXT, detaileddescription TEXT);" "CREATE TABLE compoundref (rowid INTEGER PRIMARY KEY, base_rowid INT, derived_rowid INT," " prot INT, virt INT);" "INSERT INTO path VALUES (1, 'include/a.h', 1, 1);" "INSERT INTO compounddef VALUES (1, 'ChatAdapter', 'class', 0, 1, 1, '', '')," " (2, 'QwenAdapter', 'class', 0, 1, 9, '', ''), (3, 'Base', 'class', 0, 1, 20, '', '');" "INSERT INTO compoundref VALUES (1, 1, 2, 0, 0), (2, 3, 1, 0, 0);" )
When
by_name = {c.name: c for c in header_classes(conn, "include/a.h")}
Then
- ✓ by_name["ChatAdapter"].bases equals ("Base",)
- ✓ by_name["ChatAdapter"].derived equals ("QwenAdapter",)
tests/test_wiki_apiref.py:179 · its file's page
What it checks (2)
assert by_name["ChatAdapter"].bases == ("Base",)observesheader_classesviaby_nameassert by_name["ChatAdapter"].derived == ("QwenAdapter",)observesheader_classesviaby_name
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_a_class_shows_its_bases_and_derived→header_classesWhat 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-WIKI-053 measured