test_a_declaration_takes_the_parts_only_its_definition_documents¶
Tests › tests/test_wiki_apiref.py
What this test is for
Why it exists
ENTROPIC'S AUDIT (~23 functions): the header declaration carries prose, while doxygen put the structured `parameterlist` / `simplesect` on the DEFINITION's memberdef (the `.cpp`). Each part the declaration lacks — params, returns, throws — is taken from the definition; a part it has is kept.
Given
conn = sqlite3.connect(":memory:")conn.executescript( _SCHEMA.replace( "(1, 'include/demo/api.h', 1, 1), (2, 'src/impl.cpp', 1, 1)", "(1, 'include/demo/api.h', 1, 1), (2, 'src/impl.cpp', 1, 1)", ) )conn.execute( "INSERT INTO memberdef VALUES (11, 'function', 'demo_open', NULL, 'int', 'int demo_open', " "'(const char *path)', NULL, '', ?, 5, 0, 2, 2)", ( '<para><parameterlist kind="param"><parameteritem><parameternamelist>' "<parametername>path</parametername></parameternamelist><parameterdescription>" "<para>Where the store lives.</para></parameterdescription></parameteritem>" '</parameterlist><simplesect kind="return"><para>0 on success.</para></simplesect></para>', ), )
When
(open_,) = [ s for s in header_symbols(conn, ("include/**",))["include/demo/api.h"] if s.name == "demo_open" ]
Then
- ✓ open_.doc.params equals (("path", "", "Where the store lives."),)
- ✓ open_.doc.returns equals ("0 on success.",)
- ✓ "Returns 0 on success." in open_.detail or open_.detail == "Returns 0 on success." holds
tests/test_wiki_apiref.py:295 · its file's page
What it checks (3)
assert open_.doc.params == (("path", "", "Where the store lives."),)not attributedassert open_.doc.returns == ("0 on success.",)not attributedassert "Returns 0 on success." in open_.detail or open_.detail == "Returns 0 on success."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.
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-QUERY-003 inferred
- REQ-DDB-WIKI-053 measured