From aead22a6466c03acd87fc1b374374c60d25cdce8 Mon Sep 17 00:00:00 2001 From: sirlilpanda <33928689+sirlilpanda@users.noreply.github.com> Date: Fri, 29 Aug 2025 00:11:55 +1200 Subject: [PATCH] added more test cases --- src/main.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 8d00da1..1b03bdb 100644 --- a/src/main.c +++ b/src/main.c @@ -1,21 +1,36 @@ #include "states/state.h" #include "device.h" +#include +#include int main() { Device_t device; initDevice(&device); // sets the device to off on start up - setOffState(&device); + setDeviceStateToOff(&device); + if (strcmp(device.state.state_name, "off_state.c") != 0) return 0; // turn on the device device.methods.pressPwr(&device); + if (strcmp(device.state.state_name, "lock_state.c") != 0) return 0; // send the current string device.methods.pressStrInput(&device); + if (strcmp(device.state.state_name, "lock_state.c") != 0) return 0; // send in the right string device.entered_string = "pwd"; device.methods.pressStrInput(&device); + if (strcmp(device.state.state_name, "unlock_state.c") != 0) return 0; + + // try to enter debug mode + device.entered_string = "dbg"; + device.methods.pressStrInput(&device); + if (strcmp(device.state.state_name, "debug_state.c") != 0) return 0; + + // try to power down + device.methods.pressPwr(&device); + if (strcmp(device.state.state_name, "off_state.c") != 0) return 0; return 0; }