test_a_declaration_takes_the_parts_only_its_definition_documents

Tests › tests/test_wiki_apiref.py

passed Passed in the packaged run.

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

  1. conn = sqlite3.connect(":memory:")
  2. 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)", ) )
  3. 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

  1. (open_,) = [ s for s in header_symbols(conn, ("include/**",))["include/demo/api.h"] if s.name == "demo_open" ]
→

Then

  1. ✓ open_.doc.params equals (("path", "", "Where the store lives."),)
  2. ✓ open_.doc.returns equals ("0 on success.",)
  3. ✓ "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)

  1. assert open_.doc.params == (("path", "", "Where the store lives."),) not attributed
  2. assert open_.doc.returns == ("0 on success.",) not attributed
  3. assert "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

test_a_declaration_takes_the_parts_only_its_definition_documents→header_symbols

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_a_declaration_takes_the_parts_only_its_definition_documents · 3 checksheader_symbolsdoc_textstrip_xmlREQ-DDB-QUERY-003 · inferredheader_symbolsREQ-DDB-WIKI-053 · measured
Also reaches 2 requirements

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