test_a_measured_zero_survives_the_build_signature¶
Tests › tests/test_kconfig.py
What this test is for
Why it exists
`write_build_signature` DROPS falsy values, so every count is passed as a STRING: `"0"` is truthy where `0` is not. gh#6 and gh#17 both had to work around this, and forgetting it here would erase exactly the finding that matters — "we found a Kconfig and it declares nothing".
Verifies REQ-DDB-PIPE-007 REQ-DDB-QUERY-006
Given
root = tmp_path / "empty_space"root.mkdir()
3 more
(root / KCONFIG_NAME).write_text("# a comment and nothing else\n", encoding="utf-8")db = tmp_path / "clew.db"_db_with_paths(db, ())
When
model = import_kconfig(db, root, None)write_build_signature(db, kconfig=model.as_meta())conn = sqlite3.connect(str(db))
2 more
meta = dict(conn.execute("SELECT key, value FROM build_meta"))conn.close()
Then
- ✓ model.found is True
- ✓ model.symbols equals ()
- ✓ meta["kconfig.symbol_count"] equals "0"
- ✓ meta["kconfig.source"] equals SOURCE_ROOT
tests/test_kconfig.py:801 · its file's page
What it checks (4)
assert model.found is Trueobservesimport_kconfigviamodelassert model.symbols == ()observesimport_kconfigviamodelassert meta["kconfig.symbol_count"] == "0", "the measured zero was dropped as falsy"not attributedassert meta["kconfig.source"] == SOURCE_ROOTnot attributed
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_a_measured_zero_survives_the_build_signature→_db_with_paths→import_kconfig→write_build_signatureWhat 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 (2)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-PIPE-007 | catalog | unknown |
| REQ-DDB-QUERY-006 | catalog | unknown |
Also reaches 7 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-005 measured
- REQ-DDB-CONFIG-006 measured
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-PIPE-005 measured
- REQ-DDB-PIPE-014 measured
- REQ-DDB-SCHEMA-012 measured
- REQ-DDB-SCHEMA-013 measured