test_a_declared_primitive_and_its_wait_tokens_are_read¶
Tests › tests/test_blocking_declared.py
What this test is for
Why it exists
`os_sem_wait(s, OS_WAIT_FOREVER)` is a forever wait; `OS_MS(5)` a bounded one.
Given
src = "void f(void) { os_sem_wait(&s, OS_WAIT_FOREVER); os_sem_wait(&s, OS_MS(5)); os_sem_wait(&s, OS_NO_WAIT); }"waits = [s[2] for s in sorted(_sites(src, _DECLARED), key=lambda s: s[3])]
When
- —
Then
- ✓ sorted(waits) equals ["bounded", "forever", "none"]
- ✓ _sites(src) equals []
tests/test_blocking_declared.py:40 · its file's page
What it checks (2)
assert sorted(waits) == ["bounded", "forever", "none"], waitsobserves_sitesviawaitsassert _sites(src) == [], "undeclared, the primitive is not known"observes_sites
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_declared_primitive_and_its_wait_tokens_are_read→_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 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-INDEX-002 inferred
- REQ-DDB-PIPE-003 measured