vedderb / bldc

The VESC motor control firmware
2.22k stars 1.37k forks source link

`utils_saturate_vector_2d()` unit test #459

Closed kubark42 closed 2 years ago

kubark42 commented 2 years ago

Implements a test for utils_saturate_vector_2d()

Unit test passes:

[----------] 4 tests from Saturate2dVector
[ RUN      ] Saturate2dVector.ValsInRange
[       OK ] Saturate2dVector.ValsInRange (0 ms)
[ RUN      ] Saturate2dVector.ValsOnEdgeOfRange
[       OK ] Saturate2dVector.ValsOnEdgeOfRange (0 ms)
[ RUN      ] Saturate2dVector.ValsBeyondRange
[       OK ] Saturate2dVector.ValsBeyondRange (0 ms)
[ RUN      ] Saturate2dVector.ValsAreDegenerate
[       OK ] Saturate2dVector.ValsAreDegenerate (0 ms)
[----------] 4 tests from Saturate2dVector (0 ms total)
kubark42 commented 2 years ago

@kalvdans I realized I missed tests when the values were <1, so added those in.