test_the_mbedtls_threading_guards_are_mutually_exclusive¶
Tests › tests/test_preprocessor.py
What this test is for
Why it exists
gh#35's filed case, as written in `library/threading.c`: line 103 binds `threading_mutex_lock_pthread` under `defined(MBEDTLS_THREADING_PTHREAD)` and line 127 binds `threading_mutex_fail` under `defined(MBEDTLS_THREADING_ALT)`. Exactly one holds in any real build, and this is the evaluation that lets the emitter say which.
Verifies REQ-DDB-PIPE-014
Given
cfg = PreprocessorConfig( macros=('"MBEDTLS_THREADING_C"', '"MBEDTLS_THREADING_PTHREAD"'), source=SOURCE_DECLARED, )names = cfg.defined_names
When
evaluate_condition("defined(MBEDTLS_THREADING_C)", names)evaluate_condition("defined(MBEDTLS_THREADING_PTHREAD)", names)evaluate_condition("defined(MBEDTLS_THREADING_ALT)", names)
Then
- ✓ evaluate_condition("defined(MBEDTLS_THREADING_C)", names) is True
- ✓ evaluate_condition("defined(MBEDTLS_THREADING_PTHREAD)", names) is True
- ✓ evaluate_condition("defined(MBEDTLS_THREADING_ALT)", names) is False
tests/test_preprocessor.py:773 · its file's page
What it checks (3)
assert evaluate_condition("defined(MBEDTLS_THREADING_C)", names) is Trueobservesevaluate_conditionassert evaluate_condition("defined(MBEDTLS_THREADING_PTHREAD)", names) is Trueobservesevaluate_conditionassert evaluate_condition("defined(MBEDTLS_THREADING_ALT)", names) is Falseobservesevaluate_condition
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
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.
Requirements it verifies (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-PIPE-014 | catalog | unknown |
Also reaches 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-004 measured