diff --git a/src/test/test.cpp b/src/test/test.cpp index c2d35469d..7e58999c1 100644 --- a/src/test/test.cpp +++ b/src/test/test.cpp @@ -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(); 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 diff --git a/src/test/test.h b/src/test/test.h index 3707bbfa3..df96d7e1f 100644 --- a/src/test/test.h +++ b/src/test/test.h @@ -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: