Rename test functions (#52)

This commit is contained in:
Vadim Kaushan 2020-08-26 14:44:49 +03:00 committed by GitHub
parent 1bec8dd23a
commit 5094623d04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 35 deletions

View File

@ -22,7 +22,7 @@ void pipe_record_cb(const void* value, size_t size) {
pipe_record_value = *((uint8_t*)value);
}
bool furi_pipe_record(FILE* debug_uart) {
bool test_furi_pipe_record(FILE* debug_uart) {
// 1. create pipe record
if(!furi_create("test/pipe", NULL, 0)) {
fprintf(debug_uart, "cannot create record\n");
@ -88,7 +88,7 @@ void holding_record_cb(const void* value, size_t size) {
holding_record_value = *((uint8_t*)value);
}
bool furi_holding_data(FILE* debug_uart) {
bool test_furi_holding_data(FILE* debug_uart) {
// 1. Create holding record
uint8_t holder = 0;
if(!furi_create("test/holding", (void*)&holder, sizeof(holder))) {
@ -192,7 +192,7 @@ void furi_concurent_app(void* p) {
furiac_exit(NULL);
}
bool furi_concurrent_access(FILE* debug_uart) {
bool test_furi_concurrent_access(FILE* debug_uart) {
// 1. Create holding record
ConcurrentValue holder = {.a = 0, .b = 0};
if(!furi_create("test/concurrent", (void*)&holder, sizeof(ConcurrentValue))) {
@ -256,7 +256,7 @@ TEST: non-existent data
TODO: implement this test
*/
bool furi_nonexistent_data(FILE* debug_uart) {
bool test_furi_nonexistent_data(FILE* debug_uart) {
return true;
}
@ -338,7 +338,7 @@ void furi_mute_parent_app(void* p) {
}
}
bool furi_mute_algorithm(FILE* debug_uart) {
bool test_furi_mute_algorithm(FILE* debug_uart) {
// 1. Create "parent" application:
FuriApp* parent_app = furiac_start(
furi_mute_parent_app, "parent app", (void*)debug_uart

View File

@ -23,7 +23,7 @@ void create_kill_app(void* p) {
}
}
bool furi_ac_create_kill(FILE* debug_uart) {
bool test_furi_ac_create_kill(FILE* debug_uart) {
uint8_t counter = 0;
uint8_t value_a = counter;
@ -111,7 +111,7 @@ void task_b(void* p) {
furiac_exit(p);
}
bool furi_ac_switch_exit(FILE* debug_uart) {
bool test_furi_ac_switch_exit(FILE* debug_uart) {
// init sequence
TestSwitchSequence seq;
seq.count = 0;

View File

@ -4,58 +4,58 @@
#include "flipper-core.h"
bool furi_ac_create_kill(FILE* debug_uart);
bool furi_ac_switch_exit(FILE* debug_uart);
bool test_furi_ac_create_kill(FILE* debug_uart);
bool test_furi_ac_switch_exit(FILE* debug_uart);
bool furi_pipe_record(FILE* debug_uart);
bool furi_holding_data(FILE* debug_uart);
bool furi_concurrent_access(FILE* debug_uart);
bool furi_nonexistent_data(FILE* debug_uart);
bool furi_mute_algorithm(FILE* debug_uart);
bool test_furi_pipe_record(FILE* debug_uart);
bool test_furi_holding_data(FILE* debug_uart);
bool test_furi_concurrent_access(FILE* debug_uart);
bool test_furi_nonexistent_data(FILE* debug_uart);
bool test_furi_mute_algorithm(FILE* debug_uart);
void flipper_test_app(void* p) {
FILE* debug_uart = get_debug();
if(furi_ac_create_kill(debug_uart)) {
fprintf(debug_uart, "[TEST] furi_ac_create_kill PASSED\n");
if(test_furi_ac_create_kill(debug_uart)) {
fprintf(debug_uart, "[TEST] test_furi_ac_create_kill PASSED\n");
} else {
fprintf(debug_uart, "[TEST] furi_ac_create_kill FAILED\n");
fprintf(debug_uart, "[TEST] test_furi_ac_create_kill FAILED\n");
}
if(furi_ac_switch_exit(debug_uart)) {
fprintf(debug_uart, "[TEST] furi_ac_switch_exit PASSED\n");
if(test_furi_ac_switch_exit(debug_uart)) {
fprintf(debug_uart, "[TEST] test_furi_ac_switch_exit PASSED\n");
} else {
fprintf(debug_uart, "[TEST] furi_ac_switch_exit FAILED\n");
fprintf(debug_uart, "[TEST] test_furi_ac_switch_exit FAILED\n");
}
if(furi_pipe_record(debug_uart)) {
fprintf(debug_uart, "[TEST] furi_pipe_record PASSED\n");
if(test_furi_pipe_record(debug_uart)) {
fprintf(debug_uart, "[TEST] test_furi_pipe_record PASSED\n");
} else {
fprintf(debug_uart, "[TEST] furi_pipe_record FAILED\n");
fprintf(debug_uart, "[TEST] test_furi_pipe_record FAILED\n");
}
if(furi_holding_data(debug_uart)) {
fprintf(debug_uart, "[TEST] furi_holding_data PASSED\n");
if(test_furi_holding_data(debug_uart)) {
fprintf(debug_uart, "[TEST] test_furi_holding_data PASSED\n");
} else {
fprintf(debug_uart, "[TEST] furi_holding_data FAILED\n");
fprintf(debug_uart, "[TEST] test_furi_holding_data FAILED\n");
}
if(furi_concurrent_access(debug_uart)) {
fprintf(debug_uart, "[TEST] furi_concurrent_access PASSED\n");
if(test_furi_concurrent_access(debug_uart)) {
fprintf(debug_uart, "[TEST] test_furi_concurrent_access PASSED\n");
} else {
fprintf(debug_uart, "[TEST] furi_concurrent_access FAILED\n");
fprintf(debug_uart, "[TEST] test_furi_concurrent_access FAILED\n");
}
if(furi_nonexistent_data(debug_uart)) {
fprintf(debug_uart, "[TEST] furi_nonexistent_data PASSED\n");
if(test_furi_nonexistent_data(debug_uart)) {
fprintf(debug_uart, "[TEST] test_furi_nonexistent_data PASSED\n");
} else {
fprintf(debug_uart, "[TEST] furi_nonexistent_data FAILED\n");
fprintf(debug_uart, "[TEST] test_furi_nonexistent_data FAILED\n");
}
if(furi_mute_algorithm(debug_uart)) {
fprintf(debug_uart, "[TEST] furi_mute_algorithm PASSED\n");
if(test_furi_mute_algorithm(debug_uart)) {
fprintf(debug_uart, "[TEST] test_furi_mute_algorithm PASSED\n");
} else {
fprintf(debug_uart, "[TEST] furi_mute_algorithm FAILED\n");
fprintf(debug_uart, "[TEST] test_furi_mute_algorithm FAILED\n");
}
if(add(1, 2) == 3) {