test_the_header_scan_honours_undef_and_skips_the_unreadable¶
Tests › tests/test_preprocessor.py
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
header = tmp_path / "config.h"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
names = {m.strip('"').split("=", 1)[0] for m in macros_from_header(header)}
Then
- ✓ names equals {"KEPT"}
tests/test_preprocessor.py:482 · its file's page
What it checks (1)
assert names == {"KEPT"}, f"unexpected macros harvested: {names}"observesmacros_from_headervianames
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