Skip to content

Migrate 11 legacy assert()-based tests to GTest #19

@OldCrow

Description

@OldCrow

libstats has 11 standalone tests (with main()) that use raw assert() for correctness checks. Unlike the 14 GTest-based tests, these are silently disabled in Release builds by -DNDEBUG (CMAKE_CXX_FLAGS_RELEASE).

libstats' default build type is Dev, which does not set NDEBUG, so assertions are active in day-to-day development. However, any CI job or machine that builds in Release mode loses all coverage from these tests.

Affected files (11):
test_constants, test_simd_policy, test_thread_pool, test_work_stealing_pool, test_platform_optimizations, test_atomic_parameters, test_parallel_execution_integration, test_parallel_execution_comprehensive, test_error_handling_comprehensive, test_numerical_safety, test_benchmark

Fix: Convert each to a GTest TEST() suite. This aligns them with the existing *_enhanced.cpp tests and ensures assertions are unconditional in all build types.

Library code and public API are unaffected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions