test_an_operand_hold_still_ignores_another_mutexs_release¶
Tests › tests/test_critical_sections.py
What this test is for
Why it exists
THE CONTROL THAT MATTERS. The by-name rule applies ONLY where there is no operand; a normal mutex must still ignore a release naming a different one, or every section in every C codebase would truncate at the first unrelated unlock.
Given
src = b"""\ #include <pthread.h> void touch(void); void f(pthread_mutex_t *a, pthread_mutex_t *b) { pthread_mutex_lock(a); pthread_mutex_unlock(b); touch(); pthread_mutex_unlock(a); } """sites = _sites(src, cpp=False)held = next(site for site in sites if site[OPERAND] == "a")
When
- —
Then
- ✓ held[END_LINE] equals 9
tests/test_critical_sections.py:1016 · its file's page
What it checks (1)
assert held[END_LINE] == 9, ( f"the hold on `a` ends at ITS unlock, not at `b`'s; got {held[END_LINE]}" )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_an_operand_hold_still_ignores_another_mutexs_release→_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