test_the_header_scan_reads_only_live_defines

Tests › tests/test_preprocessor.py

passed Passed in the packaged run.

What this test is for

Why it exists

The mbedtls idiom is a header of top-level defines with the alternatives COMMENTED OUT, so skipping `//#define` and `/* #define */` is not tidiness — it is the difference between reading the shipped configuration and reading every configuration the project supports at once.

Verifies REQ-DDB-PIPE-014

Given

  1. header = tmp_path / "config.h"
  2. header.write_text(CONFIG_HEADER, encoding="utf-8")
→

When

  1. macros = macros_from_header(header)
→

Then

  1. ✓ macros contains '"FIXTURE_FEATURE_C"'
  2. ✓ macros contains '"FIXTURE_WIDTH=16"'
  3. ✓ any("DISABLED" in m for m in macros) is false
  4. ✓ macros contains '"FIXTURE_CONFIG_H"'

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

What it checks (4)

  1. assert '"FIXTURE_FEATURE_C"' in macros observes macros_from_header via macros
  2. assert '"FIXTURE_WIDTH=16"' in macros, "a trailing block comment leaked into the value" observes macros_from_header via macros
  3. assert not any("DISABLED" in m for m in macros), "a commented-out define was harvested" observes macros_from_header via macros
  4. assert '"FIXTURE_CONFIG_H"' in macros, "the include guard is a define like any other" observes macros_from_header via macros

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_header_scan_reads_only_live_defines→macros_from_header

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_header_scan_reads_only_live_defines · 4 checksmacros_from_headerREQ-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.