test_a_declared_primitive_and_its_wait_tokens_are_read

Tests › tests/test_blocking_declared.py

passed Passed in the packaged run.

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

  1. 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); }"
  2. waits = [s[2] for s in sorted(_sites(src, _DECLARED), key=lambda s: s[3])]
→

When

  1. —
→

Then

  1. ✓ sorted(waits) equals ["bounded", "forever", "none"]
  2. ✓ _sites(src) equals []

tests/test_blocking_declared.py:40 · its file's page

What it checks (2)

  1. assert sorted(waits) == ["bounded", "forever", "none"], waits observes _sites via waits
  2. assert _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→_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_a_declared_primitive_and_its_wait_tokens_are_read · 2 checks_sitesblocking_harvestermanifest_keyhash_fileREQ-DDB-INDEX-002 · inferred_sitesblocking_harvestermanifest_keyREQ-DDB-PIPE-003 · measured
Also reaches 2 requirements

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