Skip to content

Commit 6e9b99e

Browse files
Add Infowarning to tests, hopefully this compiles
1 parent 2e3ae8d commit 6e9b99e

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

Src/HALAL/Services/Time/Scheduler.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ void Scheduler_start(void) {
5858
ST_LIB::TimerDomain::callbacks[ST_LIB::timer_idxmap[static_cast<uint8_t>(SCHEDULER_TIMER_DOMAIN
5959
)]] = Scheduler_global_timer_callback;
6060

61-
uint16_t prescaler = (uint16_t)(ST_LIB::TimerDomain::get_timer_frequency(Scheduler_global_timer) / Scheduler::FREQUENCY);
61+
uint16_t prescaler =
62+
(uint16_t)(ST_LIB::TimerDomain::get_timer_frequency(Scheduler_global_timer) /
63+
Scheduler::FREQUENCY);
6264
Scheduler_global_timer->PSC = prescaler;
6365
Scheduler_global_timer->ARR = 0;
6466
Scheduler_global_timer->DIER |= LL_TIM_DIER_UIE;

Tests/Time/common_tests.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <gtest/gtest.h>
22
#include "ErrorHandler/ErrorHandler.hpp"
3+
#include "HALAL/Services/InfoWarning/InfoWarning.hpp"
34

45
std::string ErrorHandlerModel::line;
56
std::string ErrorHandlerModel::func;
@@ -32,3 +33,18 @@ void ErrorHandlerModel::ErrorHandlerTrigger(string format, ...) {
3233
}
3334

3435
void ErrorHandlerModel::ErrorHandlerUpdate() {}
36+
37+
38+
void InfoWarning::SetMetaData(int line, const char* func, const char* file) {
39+
InfoWarning::line = to_string(line);
40+
InfoWarning::func = string(func);
41+
InfoWarning::file = string(file);
42+
}
43+
44+
void InfoWarning::InfoWarningTrigger(string format, ...) {
45+
(void)format;
46+
ST_LIB::TestErrorHandler::call_count++;
47+
if (ST_LIB::TestErrorHandler::fail_on_error) {
48+
EXPECT_EQ(1, 0);
49+
}
50+
}

0 commit comments

Comments
 (0)