test_a_masking_primitive_that_takes_an_operand_is_not_this_primitive

Tests › tests/test_locks.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE SPELLING COLLISION THAT MAKES A DEFAULT DANGEROUS. Zephyr's `irq_disable(irq)` (include/zephyr/irq.h:307) masks ONE interrupt line and pairs with `irq_enable`; RIOT's `irq_disable()` masks all of them and pairs with `irq_restore`. One name, two primitives.

Given

  1. sites = _sites(_CRITICAL_SECTIONS, cpp=False)
  2. argument_taking = [site for site in sites if site[3] == 24]
→

When

  1. —
→

Then

  1. ✓ argument_taking equals []
  2. ✓ [site[3] for site in sites if site[0] == "irq_disable"] equals [10]

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

What it checks (2)

  1. assert argument_taking == [], ( f"irq_disable(line) at :24 is a different primitive and must not be recorded, " f"got {argument_taking}" ) not attributed
  2. assert [site[3] for site in sites if site[0] == "irq_disable"] == [10], ( "the operand-less call at :10 is still the one that matches" ) observes _sites via 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_masking_primitive_that_takes_an_operand_is_not_this_primitive→_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_masking_primitive_that_takes_an_operand_is_not_this_primitive · 2 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.