mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-04-07 05:37:54 +03:00
style: apply clang-format and enforce left pointer alignment
This commit is contained in:
@@ -1,29 +1,22 @@
|
||||
#include "unity.h"
|
||||
#include "tools.h" // Assuming tools.h contains init_spiffs and listFiles
|
||||
#include "tools.h" // Assuming tools.h contains init_spiffs and listFiles
|
||||
|
||||
#include "test_common_init.h"
|
||||
#include "tools_spiffs_utils.h"
|
||||
static const char * TAG = "test_common";
|
||||
static const char* TAG = "test_common";
|
||||
|
||||
esp_err_t start_ota_return_code=ESP_OK;
|
||||
void start_ota_set_return(esp_err_t mockreturn){
|
||||
start_ota_return_code = mockreturn;
|
||||
|
||||
}
|
||||
esp_err_t start_ota(const char * bin_url, char * bin_buffer, uint32_t length) {
|
||||
ESP_LOGI(TAG,"Received OTA Request url %s/bin buffer size: %d. returning: %s",bin_url,length,esp_err_to_name(start_ota_return_code));
|
||||
esp_err_t start_ota_return_code = ESP_OK;
|
||||
void start_ota_set_return(esp_err_t mockreturn) { start_ota_return_code = mockreturn; }
|
||||
esp_err_t start_ota(const char* bin_url, char* bin_buffer, uint32_t length) {
|
||||
ESP_LOGI(TAG, "Received OTA Request url %s/bin buffer size: %d. returning: %s", bin_url, length, esp_err_to_name(start_ota_return_code));
|
||||
return start_ota_return_code;
|
||||
}
|
||||
esp_log_level_t SetLogLevels(esp_log_level_t level) {
|
||||
esp_log_level_set("*", level);
|
||||
return esp_log_level_get(TAG);
|
||||
}
|
||||
TEST_CASE("Raise Log Level","[test]") {
|
||||
TEST_ASSERT_TRUE(SetLogLevels(ESP_LOG_DEBUG) == ESP_LOG_DEBUG );
|
||||
}
|
||||
TEST_CASE("Lower Log Level","[test]") {
|
||||
TEST_ASSERT_TRUE(SetLogLevels(ESP_LOG_INFO) == ESP_LOG_INFO );
|
||||
}
|
||||
TEST_CASE("Raise Log Level", "[test]") { TEST_ASSERT_TRUE(SetLogLevels(ESP_LOG_DEBUG) == ESP_LOG_DEBUG); }
|
||||
TEST_CASE("Lower Log Level", "[test]") { TEST_ASSERT_TRUE(SetLogLevels(ESP_LOG_INFO) == ESP_LOG_INFO); }
|
||||
|
||||
TEST_CASE("List dir content", "[tools]") {
|
||||
common_test_init();
|
||||
|
||||
@@ -12,43 +12,35 @@
|
||||
#include "unity.h"
|
||||
#include "esp_log.h"
|
||||
#include "test_common_init.h"
|
||||
#include "tools.h" // Assuming tools.h contains init_spiffs and listFiles
|
||||
#include "tools.h" // Assuming tools.h contains init_spiffs and listFiles
|
||||
#include "freertos/task.h"
|
||||
#include "network_manager.h"
|
||||
#include "messaging.h"
|
||||
#include "tools_spiffs_utils.h"
|
||||
#include "bootstate.h"
|
||||
|
||||
static const char * TAG = "test_runner";
|
||||
bool spiffs_started=false;
|
||||
bool dummycond=false;
|
||||
static const char* TAG = "test_runner";
|
||||
bool spiffs_started = false;
|
||||
bool dummycond = false;
|
||||
static EXT_RAM_ATTR RingbufHandle_t messaging;
|
||||
|
||||
|
||||
static void print_banner(const char* text)
|
||||
{
|
||||
printf("\n#### %s #####\n\n", text);
|
||||
}
|
||||
static void print_banner(const char* text) { printf("\n#### %s #####\n\n", text); }
|
||||
|
||||
void common_test_init() {
|
||||
if(!spiffs_started){
|
||||
if(!spiffs_started) {
|
||||
spiffs_started = true;
|
||||
init_spiffs();
|
||||
listFiles(spiffs_base_path);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
void app_main() {
|
||||
esp_log_level_set("*", ESP_LOG_DEBUG);
|
||||
messaging_service_init();
|
||||
|
||||
bootstate_handle_boot();
|
||||
|
||||
|
||||
init_spiffs();
|
||||
if (esp_log_level_get(TAG) >= ESP_LOG_DEBUG) {
|
||||
listFiles(spiffs_base_path);
|
||||
}
|
||||
if(esp_log_level_get(TAG) >= ESP_LOG_DEBUG) { listFiles(spiffs_base_path); }
|
||||
|
||||
// Start the network task at this point; this is critical
|
||||
// as various subsequent init steps will post events to the queue
|
||||
@@ -56,9 +48,8 @@ void app_main() {
|
||||
|
||||
// also register a subscriber in case we need to check for results in tests
|
||||
messaging = messaging_register_subscriber(10, "test_runner");
|
||||
|
||||
|
||||
/* These are the different ways of running registered tests.
|
||||
/* These are the different ways of running registered tests.
|
||||
* In practice, only one of them is usually needed.
|
||||
*
|
||||
* UNITY_BEGIN() and UNITY_END() calls tell Unity to print a summary
|
||||
|
||||
Reference in New Issue
Block a user