Skip to content

Plain TEST() usage has regressed from 1 to 8 cases #264

Description

@gabrielfrasantos

Severity: low
Domain: testing
Status: VERIFIED — measured against a210d34 on 2026-08-10
Suggested labels: testing, policy-violation

Summary

AGENTS.md forbids plain TEST() — all tests must use TEST_F on float. There
were 1 such case at the 2026-08-03 tree; there are now 8.

Measurement

$ grep -rnE '^\s*TEST\(' numerical --include=*.cpp

Locations

numerical/math/test/TestQNumber.cpp — 4 cases:

TEST(QNumberUtilTest, ToFloatFreeFunction_Float)
TEST(QNumberUtilTest, MinMaxLowest_Float)
TEST(QNumberUtilTest, MinMaxLowest_Q31)
TEST(QNumberUtilTest, MinMaxLowest_Q15)

numerical/robust_control/test/TestActiveDisturbanceRejection.cpp — 4 cases:

TEST(TestBinomialCoeff, k_zero_returns_one)
TEST(TestBinomialCoeff, k_equals_n_returns_one)
TEST(TestBinomialCoeff, k_greater_than_n_returns_zero)
TEST(TestBinomialCoeff, known_interior_values)

Suggested fix

Convert each to a TEST_F with an anonymous-namespace fixture, per the testing policy. The
TestBinomialCoeff cases are free-function tests, so they need a trivial fixture.

The QNumberUtilTest cases also test Q15/Q31, which is a separate policy question — see
issue 019.

Prevention

Consider a lint rule (the repository already has .github/linters/goodcheck.yml) that rejects
^\s*TEST\( in numerical/**/test/**.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions