mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-20 09:43:23 +00:00
b835d7a451
* Furi: replace obsolete furiac_exit with osThreadExit, drop obsolete apis and test. Rename systemd to flipper and move to separate file, cleanup. ApiHal: Rename timebase to os and move freertos hooks there, move insomnia api to power module. * Furi: new thread helper * Furi: cleanup thread documentation * Flipper, AppLoader: update to use FuriThread. Update tasks signatures to match FuriThreadCallback signature. * F4: rename API_HAL_TIMEBASE_DEBUG to API_HAL_OS_DEBUG * Applications: rename FuriApplication to FlipperApplication, use FuriThreadCallback signature for apps. * C++ app template sample, new exit method
69 lines
No EOL
1.3 KiB
C
69 lines
No EOL
1.3 KiB
C
#include <stdio.h>
|
|
#include <furi.h>
|
|
#include "minunit_vars.h"
|
|
#include "minunit.h"
|
|
|
|
// v2 tests
|
|
void test_furi_create_open();
|
|
void test_furi_valuemutex();
|
|
void test_furi_concurrent_access();
|
|
void test_furi_pubsub();
|
|
|
|
void test_furi_memmgr();
|
|
|
|
static int foo = 0;
|
|
|
|
void test_setup(void) {
|
|
foo = 7;
|
|
}
|
|
|
|
void test_teardown(void) {
|
|
/* Nothing */
|
|
}
|
|
|
|
MU_TEST(test_check) {
|
|
mu_check(foo != 6);
|
|
}
|
|
|
|
// v2 tests
|
|
MU_TEST(mu_test_furi_create_open) {
|
|
test_furi_create_open();
|
|
}
|
|
|
|
MU_TEST(mu_test_furi_valuemutex) {
|
|
test_furi_valuemutex();
|
|
}
|
|
|
|
MU_TEST(mu_test_furi_concurrent_access) {
|
|
test_furi_concurrent_access();
|
|
}
|
|
|
|
MU_TEST(mu_test_furi_pubsub) {
|
|
test_furi_pubsub();
|
|
}
|
|
|
|
MU_TEST(mu_test_furi_memmgr) {
|
|
// this test is not accurate, but gives a basic understanding
|
|
// that memory management is working fine
|
|
test_furi_memmgr();
|
|
}
|
|
|
|
MU_TEST_SUITE(test_suite) {
|
|
MU_SUITE_CONFIGURE(&test_setup, &test_teardown);
|
|
|
|
MU_RUN_TEST(test_check);
|
|
|
|
// v2 tests
|
|
MU_RUN_TEST(mu_test_furi_create_open);
|
|
MU_RUN_TEST(mu_test_furi_valuemutex);
|
|
MU_RUN_TEST(mu_test_furi_concurrent_access);
|
|
MU_RUN_TEST(mu_test_furi_pubsub);
|
|
MU_RUN_TEST(mu_test_furi_memmgr);
|
|
}
|
|
|
|
int run_minunit() {
|
|
MU_RUN_SUITE(test_suite);
|
|
MU_REPORT();
|
|
|
|
return MU_EXIT_CODE;
|
|
} |