test_a_guarded_body_is_parsed_even_though_doxygen_saw_nothing

Tests › tests/test_ast_symbols.py

passed Passed in the packaged run.

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

  1. tree = SubstrateParser("c").parse(_GUARDED_C.encode())
→

When

  1. found = {f.name: f for f in harvest_function_definitions(tree, _GUARDED_C.encode())}
→

Then

  1. ✓ set(found) equals { "mutex_lock_pthread", "mutex_unlock_pthread", "demo_body_local_is_not_a_global", }
  2. ✓ found does not contain "demo_prototype_not_a_variable"
  3. ✓ found["mutex_lock_pthread"].static is True
  4. ✓ found["mutex_unlock_pthread"].static is False
  5. ✓ found["mutex_unlock_pthread"].args equals "(void *mutex, int flags)"

tests/test_ast_symbols.py:260 · its file's page

What it checks (5)

  1. assert set(found) == { "mutex_lock_pthread", "mutex_unlock_pthread", "demo_body_local_is_not_a_global", } observes harvest_function_definitions via found
  2. assert "demo_prototype_not_a_variable" not in found observes harvest_function_definitions via found
  3. assert found["mutex_lock_pthread"].static is True observes harvest_function_definitions via found
  4. assert found["mutex_unlock_pthread"].static is False observes harvest_function_definitions via found
  5. assert found["mutex_unlock_pthread"].args == "(void *mutex, int flags)" observes harvest_function_definitions via found

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_guarded_body_is_parsed_even_though_doxygen_saw_nothing→harvest_function_definitions

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_guarded_body_is_parsed_even_though_doxygen_saw_nothing · 5 checksharvest_function_definitionsREQ-DDB-INDEX-004 · measured
Also reaches 2 requirements

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