Summary
Add tests for the four utility functions in include/neat_tools/utils.h that currently have zero coverage.
Motivation
tests/test_utils.cpp only tests the three generateRandom*() functions. The normalization and signal-generation helpers below are exercised at runtime but never verified in the test suite, so regressions in their behaviour would go undetected.
Proposed Solution
Extend tests/test_utils.cpp with TEST_CASE blocks for:
-
normalize(value, min, max) — linear normalization to [0, 1]
- value == min → 0.0
- value == max → 1.0
- value at midpoint → 0.5
- value outside [min, max] (document and assert the boundary behaviour)
-
normalizeWithGaussian(value, target, width) — Gaussian-shaped score
- value == target → maximum output (1.0)
- value far from target → output close to 0.0
- width = 0 edge case
-
normalizeWithFlatheadGaussian(value, min, max, width) — flat-top Gaussian
- value inside flat region → 1.0
- value outside flat region → decreases toward 0.0
-
generateRandomSignal() — returns +1 or -1
- over 1 000 calls, only +1 and -1 are observed
Files to touch: tests/test_utils.cpp
Summary
Add tests for the four utility functions in
include/neat_tools/utils.hthat currently have zero coverage.Motivation
tests/test_utils.cpponly tests the threegenerateRandom*()functions. The normalization and signal-generation helpers below are exercised at runtime but never verified in the test suite, so regressions in their behaviour would go undetected.Proposed Solution
Extend
tests/test_utils.cppwithTEST_CASEblocks for:normalize(value, min, max)— linear normalization to [0, 1]normalizeWithGaussian(value, target, width)— Gaussian-shaped scorenormalizeWithFlatheadGaussian(value, min, max, width)— flat-top GaussiangenerateRandomSignal()— returns +1 or -1Files to touch:
tests/test_utils.cpp