test_a_commented_argument_does_not_shift_the_timeout¶
Tests › tests/test_locks.py
What this test is for
Why it exists
A COMMENT IS A NAMED CHILD of the argument list in tree-sitter-c, so reading the Nth named child reads the wrong argument the moment anyone documents one inline — which vendor headers and RTOS demos do constantly.
Given
src = b"""\ void f(void) { xEventGroupWaitBits(eg, BIT0, /* xClearOnExit */ pdTRUE, pdFALSE, portMAX_DELAY); k_sem_take(&sem, /* wait */ K_FOREVER); } """parser = Parser("c")
When
sites = walk_blocking_sites( parser.parse(src), src, {p.name: p for p in DEFAULT_BLOCKING_PATTERNS} )waits = {site[0]: (site[2], site[3]) for site in sites}
Then
- ✓ waits["xEventGroupWaitBits"] equals ("forever", "portMAX_DELAY")
- ✓ waits["k_sem_take"] equals ("forever", "K_FOREVER")
tests/test_locks.py:563 · its file's page
What it checks (2)
assert waits["xEventGroupWaitBits"] == ("forever", "portMAX_DELAY"), ( f"the comment must not shift the timeout argument, got {waits['xEventGroupWaitBits']}" )not attributedassert waits["k_sem_take"] == ("forever", "K_FOREVER"), ( f"same for a comment sitting immediately before the timeout, got {waits['k_sem_take']}" )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_commented_argument_does_not_shift_the_timeout→walk_blocking_sitesWhat 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 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-PIPE-003 measured