Four tests in tests/test_ts_lsp.c start with if (!buf) PASS(); (lines ~719, 2794, 2978, 3046). If allocating the input buffer fails, the test reports a pass without exercising anything.
A test's verdict should never depend on an allocation succeeding. It should fail loudly instead: ASSERT_NOT_NULL(buf);.
Found while reviewing #2091, which copied the same pattern into two new tests (asked to change there).
Four tests in
tests/test_ts_lsp.cstart withif (!buf) PASS();(lines ~719, 2794, 2978, 3046). If allocating the input buffer fails, the test reports a pass without exercising anything.A test's verdict should never depend on an allocation succeeding. It should fail loudly instead:
ASSERT_NOT_NULL(buf);.Found while reviewing #2091, which copied the same pattern into two new tests (asked to change there).