test_the_index_cache_tree_hash_notices_a_changed_predefined¶
Tests › tests/test_preprocessor.py
What this test is for
Why it exists
THE silent-wrong-answer test. A changed `preprocessor:` declaration touches no source file and no Doxyfile, so if the macro text reached the doxygen RUN but not the hash, editing the declared macros would replay the previous configuration's parse straight out of cache and report success — a well-formed index of the variant the owner just stopped declaring, with nothing anywhere saying so.
Verifies REQ-DDB-PIPE-014
Given
root = _fixture_repo(tmp_path)doxyfile = root / "Doxyfile"cache = IndexCache(tmp_path / "cache.db", Path(root))
When
try: shas = { label: cache.tree_sha(doxyfile_content_for(doxyfile, predefined=text), []) for label, text in ( ("none", ""), ("feature", doxyfile_lines(PreprocessorConfig(macros=('"FIXTURE_FEATURE_C"',)))), ("width", doxyfile_lines(PreprocessorConfig(macros=('"FIXTURE_WIDTH=16"',)))), ) } finally: cache.close()
Then
- ✓ len(set(shas.values())) equals 3
tests/test_preprocessor.py:391 · its file's page
What it checks (1)
assert len(set(shas.values())) == 3, ( f"the tree hash does not distinguish these configurations: {shas}" )observesdoxyfile_content_forviashas
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_index_cache_tree_hash_notices_a_changed_predefined→_fixture_repo→doxyfile_content_for→doxyfile_linesWhat 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 4 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-004 measured
- REQ-DDB-INDEX-001 measured
- REQ-DDB-INDEX-002 measured
- REQ-DDB-PIPE-003 measured