2020-08-24 15:31:22 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include "flipper.h"
|
2020-08-26 18:32:22 +00:00
|
|
|
#include "log.h"
|
2020-08-24 15:31:22 +00:00
|
|
|
|
2020-08-26 10:08:20 +00:00
|
|
|
#include "flipper-core.h"
|
|
|
|
|
2020-08-26 18:32:22 +00:00
|
|
|
bool test_furi_ac_create_kill(FuriRecordSubscriber* log);
|
|
|
|
bool test_furi_ac_switch_exit(FuriRecordSubscriber* log);
|
2020-08-24 15:31:22 +00:00
|
|
|
|
2020-08-26 18:32:22 +00:00
|
|
|
bool test_furi_pipe_record(FuriRecordSubscriber* log);
|
|
|
|
bool test_furi_holding_data(FuriRecordSubscriber* log);
|
|
|
|
bool test_furi_concurrent_access(FuriRecordSubscriber* log);
|
|
|
|
bool test_furi_nonexistent_data(FuriRecordSubscriber* log);
|
|
|
|
bool test_furi_mute_algorithm(FuriRecordSubscriber* log);
|
2020-08-24 15:31:22 +00:00
|
|
|
|
|
|
|
void flipper_test_app(void* p) {
|
2020-08-26 18:32:22 +00:00
|
|
|
FuriRecordSubscriber* log = get_default_log();
|
|
|
|
|
|
|
|
if(test_furi_ac_create_kill(log)) {
|
|
|
|
fuprintf(log, "[TEST] test_furi_ac_create_kill PASSED\n");
|
2020-08-24 15:31:22 +00:00
|
|
|
} else {
|
2020-08-26 18:32:22 +00:00
|
|
|
fuprintf(log, "[TEST] test_furi_ac_create_kill FAILED\n");
|
2020-08-24 15:31:22 +00:00
|
|
|
}
|
|
|
|
|
2020-08-26 18:32:22 +00:00
|
|
|
if(test_furi_ac_switch_exit(log)) {
|
|
|
|
fuprintf(log, "[TEST] test_furi_ac_switch_exit PASSED\n");
|
2020-08-24 15:31:22 +00:00
|
|
|
} else {
|
2020-08-26 18:32:22 +00:00
|
|
|
fuprintf(log, "[TEST] test_furi_ac_switch_exit FAILED\n");
|
2020-08-24 15:31:22 +00:00
|
|
|
}
|
|
|
|
|
2020-08-26 18:32:22 +00:00
|
|
|
if(test_furi_pipe_record(log)) {
|
|
|
|
fuprintf(log, "[TEST] test_furi_pipe_record PASSED\n");
|
2020-08-24 15:31:22 +00:00
|
|
|
} else {
|
2020-08-26 18:32:22 +00:00
|
|
|
fuprintf(log, "[TEST] test_furi_pipe_record FAILED\n");
|
2020-08-24 15:31:22 +00:00
|
|
|
}
|
|
|
|
|
2020-08-26 18:32:22 +00:00
|
|
|
if(test_furi_holding_data(log)) {
|
|
|
|
fuprintf(log, "[TEST] test_furi_holding_data PASSED\n");
|
2020-08-24 15:31:22 +00:00
|
|
|
} else {
|
2020-08-26 18:32:22 +00:00
|
|
|
fuprintf(log, "[TEST] test_furi_holding_data FAILED\n");
|
2020-08-24 15:31:22 +00:00
|
|
|
}
|
|
|
|
|
2020-08-26 18:32:22 +00:00
|
|
|
if(test_furi_concurrent_access(log)) {
|
|
|
|
fuprintf(log, "[TEST] test_furi_concurrent_access PASSED\n");
|
2020-08-24 15:31:22 +00:00
|
|
|
} else {
|
2020-08-26 18:32:22 +00:00
|
|
|
fuprintf(log, "[TEST] test_furi_concurrent_access FAILED\n");
|
2020-08-24 15:31:22 +00:00
|
|
|
}
|
|
|
|
|
2020-08-26 18:32:22 +00:00
|
|
|
if(test_furi_nonexistent_data(log)) {
|
|
|
|
fuprintf(log, "[TEST] test_furi_nonexistent_data PASSED\n");
|
2020-08-24 15:31:22 +00:00
|
|
|
} else {
|
2020-08-26 18:32:22 +00:00
|
|
|
fuprintf(log, "[TEST] test_furi_nonexistent_data FAILED\n");
|
2020-08-24 15:31:22 +00:00
|
|
|
}
|
|
|
|
|
2020-08-26 18:32:22 +00:00
|
|
|
if(test_furi_mute_algorithm(log)) {
|
|
|
|
fuprintf(log, "[TEST] test_furi_mute_algorithm PASSED\n");
|
2020-08-24 15:31:22 +00:00
|
|
|
} else {
|
2020-08-26 18:32:22 +00:00
|
|
|
fuprintf(log, "[TEST] test_furi_mute_algorithm FAILED\n");
|
2020-08-24 15:31:22 +00:00
|
|
|
}
|
|
|
|
|
2020-08-26 10:08:20 +00:00
|
|
|
if(add(1, 2) == 3) {
|
2020-08-26 18:32:22 +00:00
|
|
|
fuprintf(log, "[TEST] Rust add PASSED\n");
|
2020-08-26 10:08:20 +00:00
|
|
|
} else {
|
2020-08-26 18:32:22 +00:00
|
|
|
fuprintf(log, "[TEST] Rust add FAILED\n");
|
2020-08-26 10:08:20 +00:00
|
|
|
}
|
|
|
|
|
2020-08-24 15:31:22 +00:00
|
|
|
furiac_exit(NULL);
|
|
|
|
}
|