Skip to content

tests: ts_lsp tests pass on allocation failure instead of failing #2387

Description

@DeusData

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions