test_a_declared_config_header_outside_the_repository_is_refused¶
Tests › tests/test_preprocessor.py
What this test is for
Why it exists
H4's second site. `preprocessor.config_header` is repo-relative by contract and was resolved without containment, so a declared — or MCP-STATED — `/etc/hostname` or `../outside.h` was read and its `#define`s became this index's macro set. The macro values then reach the Doxyfile's PREDEFINED, which is how a read turns into content an agent is served as the repository's own configuration.
Given
outside = tmp_path / "outside.h"outside.write_text("#define SENTINEL_LEAKED 1\n", encoding="utf-8")
2 more
root = tmp_path / "repo"root.mkdir()
When
for declared in (str(outside), "../outside.h"): config = resolve_preprocessor(root, {SECTION_PREPROCESSOR: {"config_header": declared}}) assert config.macros == (), ( f"{declared!r} escapes the repository; got macros {config.macros}" ) assert config.config_header is None, ( f"a refused header must not be recorded as honoured; got {config.config_header}" )
Then
- —
tests/test_preprocessor.py:865 · its file's page
What it checks (2)
assert config.macros == (), ( f"{declared!r} escapes the repository; got macros {config.macros}" )observesresolve_preprocessorviaconfigassert config.config_header is None, ( f"a refused header must not be recorded as honoured; got {config.config_header}" )observesresolve_preprocessorviaconfig
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.
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-004 measured
- REQ-DDB-PIPE-014 measured