test_the_header_scan_honours_undef_and_skips_the_unreadable

Tests › tests/test_preprocessor.py

passed Passed in the packaged run.

What this test is for

Why it exists

Three refusals, each because a wrong answer here is worse than no answer. `#undef` must win, or a header that REVOKES a macro is read as defining it. A function-like macro is not a configuration statement. A continued macro cannot be read a line at a time, and half a value handed to doxygen as a whole one is a wrong answer wearing the shape of a right one.

Verifies REQ-DDB-PIPE-014

Given

  1. header = tmp_path / "config.h"
  2. header.write_text( "#define KEPT 1\n" "#define REVOKED 1\n" "#undef REVOKED\n" "#define FUNCLIKE(x) ((x) + 1)\n" "#define CONTINUED a \\\n b\n", encoding="utf-8", )
→

When

  1. names = {m.strip('"').split("=", 1)[0] for m in macros_from_header(header)}
→

Then

  1. ✓ names equals {"KEPT"}

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

What it checks (1)

  1. assert names == {"KEPT"}, f"unexpected macros harvested: {names}" observes macros_from_header via names

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_honours_undef_and_skips_the_unreadable→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_honours_undef_and_skips_the_unreadable · 1 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.