test_an_unbalanced_lock_yields_no_extent_and_NO_membership¶
Tests › tests/test_critical_sections.py
What this test is for
Why it exists
The primary fail-closed case. With no release at all the hold escapes the function, so its extent is unknown — and an unknown extent must produce no membership rather than a partial list, because a partial list is indistinguishable from a complete one to whoever reads it.
Given
src = b"""\ void leaks(void) { pthread_mutex_lock(&orphan_lock); might_be_under_it(); } """site = next(s for s in _sites(src, cpp=False) if s[OPERAND] == "orphan_lock")
When
- —
Then
- ✓ site[END_LINE] is None
- ✓ site[CALLS] equals []
- ✓ site[CONFIDENCE] equals EXTENT_UNRESOLVED
tests/test_critical_sections.py:231 · its file's page
What it checks (3)
assert site[END_LINE] is Noneobserves_sitesviasiteassert site[CALLS] == []observes_sitesviasiteassert site[CONFIDENCE] == EXTENT_UNRESOLVEDobserves_sitesviasite
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_an_unbalanced_lock_yields_no_extent_and_NO_membership→_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-PIPE-003 measured
- REQ-DDB-SCHEMA-011 measured