test_a_guarded_body_is_parsed_even_though_doxygen_saw_nothing¶
Tests › tests/test_ast_symbols.py
What this test is for
Why it exists
The premise of the whole issue: the parser does not care about the preprocessor. Asserted on the harvest alone, so a failure here separates "we cannot see these functions" from "we cannot store them".
Given
tree = SubstrateParser("c").parse(_GUARDED_C.encode())
When
found = {f.name: f for f in harvest_function_definitions(tree, _GUARDED_C.encode())}
Then
- ✓ set(found) equals { "mutex_lock_pthread", "mutex_unlock_pthread", "demo_body_local_is_not_a_global", }
- ✓ found does not contain "demo_prototype_not_a_variable"
- ✓ found["mutex_lock_pthread"].static is True
- ✓ found["mutex_unlock_pthread"].static is False
- ✓ found["mutex_unlock_pthread"].args equals "(void *mutex, int flags)"
tests/test_ast_symbols.py:260 · its file's page
What it checks (5)
assert set(found) == { "mutex_lock_pthread", "mutex_unlock_pthread", "demo_body_local_is_not_a_global", }observesharvest_function_definitionsviafoundassert "demo_prototype_not_a_variable" not in foundobservesharvest_function_definitionsviafoundassert found["mutex_lock_pthread"].static is Trueobservesharvest_function_definitionsviafoundassert found["mutex_unlock_pthread"].static is Falseobservesharvest_function_definitionsviafoundassert found["mutex_unlock_pthread"].args == "(void *mutex, int flags)"observesharvest_function_definitionsviafound
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-INDEX-004 measured
- REQ-DDB-PIPE-003 measured