mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 17:29:50 +03:00
add test to crash EMS-ESP
This commit is contained in:
@@ -934,8 +934,6 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd) {
|
||||
shell.printfln(F("Testing RESTful API..."));
|
||||
Mqtt::ha_enabled(false);
|
||||
run_test("general");
|
||||
DynamicJsonDocument doc(EMSESP_JSON_SIZE_XXLARGE_DYN);
|
||||
JsonObject json = doc.to<JsonObject>();
|
||||
AsyncWebServerRequest request;
|
||||
request.method(HTTP_GET);
|
||||
request.url("/api/thermostat/seltemp");
|
||||
@@ -945,6 +943,18 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd) {
|
||||
EMSESP::webAPIService.webAPIService_get(&request);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (command == "crash") {
|
||||
shell.printfln(F("Forcing a crash..."));
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdiv-by-zero"
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
uint8_t a = 2 / 0;
|
||||
shell.printfln(F("Testing %s"), a);
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
}
|
||||
|
||||
// simulates a telegram in the Rx queue, but without the CRC which is added automatically
|
||||
|
||||
@@ -38,7 +38,8 @@ namespace emsesp {
|
||||
// #define EMSESP_DEBUG_DEFAULT "board_profile"
|
||||
// #define EMSESP_DEBUG_DEFAULT "shower_alert"
|
||||
// #define EMSESP_DEBUG_DEFAULT "310"
|
||||
#define EMSESP_DEBUG_DEFAULT "api"
|
||||
// #define EMSESP_DEBUG_DEFAULT "api"
|
||||
#define EMSESP_DEBUG_DEFAULT "crash"
|
||||
|
||||
class Test {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user