This commit is contained in:
2025-05-13 01:34:53 +03:00
parent 427735e23d
commit 83f3f1c7d4
945 changed files with 633484 additions and 0 deletions
@@ -0,0 +1,29 @@
#include <doctest.h>
#include "MotorControl/timer.hpp"
#include <stdint.h>
TEST_CASE_TEMPLATE("Timer2", T, float, int, char, uint32_t){
Timer<T> myTimer;
myTimer.setTimeout(10);
myTimer.setIncrement(1);
CHECK(!myTimer.expired());
myTimer.start();
CHECK(!myTimer.expired());
for(int i = 0; i < 9; ++i){
myTimer.update();
CHECK(!myTimer.expired());
}
myTimer.update();
CHECK(myTimer.expired());
myTimer.stop();
CHECK(myTimer.expired());
myTimer.start();
CHECK(myTimer.expired());
myTimer.reset();
CHECK(!myTimer.expired());
}