test_critical_section_primitives_ship_as_defaults_with_a_non_blocking_kind¶
Tests › tests/test_locks.py
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
sites = _sites(_CRITICAL_SECTIONS, cpp=False)by_name = {site[0]: site for site in sites}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
- —
Then
- ✓ by_name contains "irq_disable"
- ✓ by_name contains "taskENTER_CRITICAL"
- ✓ by_name["irq_disable"][4] equals 12
- ✓ by_name["taskENTER_CRITICAL"][4] equals 19
tests/test_locks.py:476 · its file's page
What it checks (6)
assert "irq_disable" in by_name, ( f"irq_disable must be a built-in primitive; found {sorted(by_name)}" )not attributedassert "taskENTER_CRITICAL" in by_name, ( f"taskENTER_CRITICAL must be built in; found {sorted(by_name)}" )not attributedassert by_name[name][6] == "interrupt_mask", ( f"{name} masks interrupts; it is not a mutex, got kind {by_name[name][6]!r}" )not attributedassert by_name[name][2] == "global", ( f"{name} holds a global, got scope {by_name[name][2]!r}" )not attributedassert by_name["irq_disable"][4] == 12, ( f"the RIOT-style hold ends at its irq_restore, got {by_name['irq_disable'][4]}" )not attributedassert 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→_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