Preparing for the unit testing of events

This commit is contained in:
Cabooman 2024-02-12 01:42:35 +01:00
parent 3dfbf7b436
commit d12fe99e8e
2 changed files with 20 additions and 2 deletions

View file

@ -1,6 +1,8 @@
#include "events.h" #include "events.h"
#ifndef UNIT_TEST
#include <EEPROM.h> #include <EEPROM.h>
#endif
#include "../../../USER_SETTINGS.h" #include "../../../USER_SETTINGS.h"
#include "../config.h" #include "../config.h"

View file

@ -2,9 +2,26 @@
#include "../test_lib.h" #include "../test_lib.h"
#include "../../Software/src/devboard/config.h" #include "../../Software/src/devboard/config.h"
#include "../../Software/src/devboard/utils/events.cpp"
#include "../../Software/src/devboard/utils/timer.cpp" #include "../../Software/src/devboard/utils/timer.cpp"
class EEPROMClass {
public:
void begin(int s) {}
void writeUShort(int a, uint16_t d) {}
void commit(void) {}
uint16_t readUShort(int a) {}
template<typename T>
void get(int address, T &t) {}
template<typename T>
void put(int address, const T &t) {}
};
EEPROMClass EEPROM;
#include "../../Software/src/devboard/utils/events.cpp"
/* Local rest variables */ /* Local rest variables */
bool elapsed = false; bool elapsed = false;
@ -12,7 +29,6 @@ bool elapsed = false;
void run_sequence_on_target(void) {} void run_sequence_on_target(void) {}
/* Helper functions */ /* Helper functions */
/* Test functions */ /* Test functions */
TEST(init_events_test) { TEST(init_events_test) {