test_critical_section_primitives_ship_as_defaults_with_a_non_blocking_kind

Tests › tests/test_locks.py

passed Passed in the packaged run.

What this test is for

Why it exists

gh#47 part 3. Interrupt masking was DECLARABLE ONLY, and the acceptance target that grades it (`acceptance/targets/riot`) builds with `declare: {}` — so on the arm the feature exists for, nothing was detected at all.

Given

  1. sites = _sites(_CRITICAL_SECTIONS, cpp=False)
  2. by_name = {site[0]: site for site in sites}
  3. for name in ("irq_disable", "taskENTER_CRITICAL"): assert by_name[name][6] == "interrupt_mask", ( f"{name} masks interrupts; it is not a mutex, got kind {by_name[name][6]!r}" ) assert by_name[name][2] == "global", ( f"{name} holds a global, got scope {by_name[name][2]!r}" )
→

When

  1. —
→

Then

  1. ✓ by_name contains "irq_disable"
  2. ✓ by_name contains "taskENTER_CRITICAL"
  3. ✓ by_name["irq_disable"][4] equals 12
  4. ✓ by_name["taskENTER_CRITICAL"][4] equals 19

tests/test_locks.py:476 · its file's page

What it checks (6)

  1. assert "irq_disable" in by_name, ( f"irq_disable must be a built-in primitive; found {sorted(by_name)}" ) not attributed
  2. assert "taskENTER_CRITICAL" in by_name, ( f"taskENTER_CRITICAL must be built in; found {sorted(by_name)}" ) not attributed
  3. assert by_name[name][6] == "interrupt_mask", ( f"{name} masks interrupts; it is not a mutex, got kind {by_name[name][6]!r}" ) not attributed
  4. assert by_name[name][2] == "global", ( f"{name} holds a global, got scope {by_name[name][2]!r}" ) not attributed
  5. assert by_name["irq_disable"][4] == 12, ( f"the RIOT-style hold ends at its irq_restore, got {by_name['irq_disable'][4]}" ) not attributed
  6. assert by_name["taskENTER_CRITICAL"][4] == 19, ( f"the FreeRTOS-style hold ends at its taskEXIT_CRITICAL, got {by_name['taskENTER_CRITICAL'][4]}" ) 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_critical_section_primitives_ship_as_defaults_with_a_non_blocking_kind→_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_critical_section_primitives_ship_as_defaults_with_a_non_blocking_kind · 6 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.