test_an_operand_hold_still_ignores_another_mutexs_release

Tests › tests/test_critical_sections.py

passed Passed in the packaged run.

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

  1. 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); } """
  2. sites = _sites(src, cpp=False)
  3. held = next(site for site in sites if site[OPERAND] == "a")
→

When

  1. —
→

Then

  1. ✓ held[END_LINE] equals 9

tests/test_critical_sections.py:1016 · its file's page

What it checks (1)

  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→_sites

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_an_operand_hold_still_ignores_another_mutexs_release · 1 checks_sites… 4 calls …enclosingREQ-DDB-PIPE-003 · measured_sites… 4 calls …resolve_sectionREQ-DDB-SCHEMA-011 · measured
Also reaches 2 requirements

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