test_evaluate_condition_reports_unknown_rather_than_guessing¶
Tests › tests/test_preprocessor.py
What this test is for
Why it exists
THE LOAD-BEARING CASE for gh#35. None means "we do not know which branch is live", and it must never collapse to False — a False here would DELETE the live edge of every binding guarded by an expression this evaluator cannot parse, which is worse than the over-complete graph gh#35 is fixing.
Verifies REQ-DDB-PIPE-014
Given
on = frozenset({"A"})
When
evaluate_condition("_POSIX_VERSION >= 200809L", on)evaluate_condition("A", on)evaluate_condition("__has_include(<foo.h>)", on)evaluate_condition("!(A + 1)", on)
Then
- ✓ evaluate_condition("_POSIX_VERSION >= 200809L", on) is None
- ✓ evaluate_condition("A", on) is None
- ✓ evaluate_condition("__has_include(<foo.h>)", on) is None
- ✓ evaluate_condition("!(A + 1)", on) is None
tests/test_preprocessor.py:740 · its file's page
What it checks (4)
assert evaluate_condition("_POSIX_VERSION >= 200809L", on) is Noneobservesevaluate_conditionassert evaluate_condition("A", on) is Noneobservesevaluate_conditionassert evaluate_condition("__has_include(<foo.h>)", on) is Noneobservesevaluate_conditionassert evaluate_condition("!(A + 1)", on) is Noneobservesevaluate_condition
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