test_the_mbedtls_threading_guards_are_mutually_exclusive

Tests › tests/test_preprocessor.py

passed Passed in the packaged run.

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

  1. cfg = PreprocessorConfig( macros=('"MBEDTLS_THREADING_C"', '"MBEDTLS_THREADING_PTHREAD"'), source=SOURCE_DECLARED, )
  2. names = cfg.defined_names
→

When

  1. evaluate_condition("defined(MBEDTLS_THREADING_C)", names)
  2. evaluate_condition("defined(MBEDTLS_THREADING_PTHREAD)", names)
  3. evaluate_condition("defined(MBEDTLS_THREADING_ALT)", names)
→

Then

  1. ✓ evaluate_condition("defined(MBEDTLS_THREADING_C)", names) is True
  2. ✓ evaluate_condition("defined(MBEDTLS_THREADING_PTHREAD)", names) is True
  3. ✓ evaluate_condition("defined(MBEDTLS_THREADING_ALT)", names) is False

tests/test_preprocessor.py:773 · its file's page

What it checks (3)

  1. assert evaluate_condition("defined(MBEDTLS_THREADING_C)", names) is True observes evaluate_condition
  2. assert evaluate_condition("defined(MBEDTLS_THREADING_PTHREAD)", names) is True observes evaluate_condition
  3. assert evaluate_condition("defined(MBEDTLS_THREADING_ALT)", names) is False observes evaluate_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

test_the_mbedtls_threading_guards_are_mutually_exclusive→evaluate_condition

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_the_mbedtls_threading_guards_are_mutually_exclusive · 3 checksevaluate_conditionREQ-DDB-CONFIG-004 · measured

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-PIPE-014catalogunknown
Also reaches 1 requirement

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