Merge remote-tracking branch 'ofw/dev' into mntm-dev

This commit is contained in:
Willy-JL
2025-04-04 07:37:27 +01:00
52 changed files with 1170 additions and 606 deletions

View File

@@ -4,7 +4,7 @@ App(
entry_point="unit_tests_on_system_start",
sources=["unit_tests.c", "test_runner.c", "unit_test_api_table.cpp"],
cdefines=["APP_UNIT_TESTS"],
requires=["system_settings", "subghz_start"],
requires=["system_settings", "cli_subghz"],
provides=["delay_test"],
resources="resources",
order=100,

View File

@@ -70,10 +70,9 @@ static void on_data_arrived(PipeSide* pipe, void* context) {
}
static void on_space_freed(PipeSide* pipe, void* context) {
UNUSED(pipe);
AncillaryThreadContext* ctx = context;
ctx->flag |= TestFlagSpaceFreed;
const char* message = "Hi!";
pipe_send(pipe, message, strlen(message));
}
static void on_became_broken(PipeSide* pipe, void* context) {
@@ -119,16 +118,10 @@ MU_TEST(pipe_test_event_loop) {
size_t size = pipe_receive(alice, buffer_1, strlen(message));
buffer_1[size] = 0;
char buffer_2[16];
const char* expected_reply = "Hi!";
size = pipe_receive(alice, buffer_2, strlen(expected_reply));
buffer_2[size] = 0;
pipe_free(alice);
furi_thread_join(thread);
mu_assert_string_eq(message, buffer_1);
mu_assert_string_eq(expected_reply, buffer_2);
mu_assert_int_eq(
TestFlagDataArrived | TestFlagSpaceFreed | TestFlagBecameBroken,
furi_thread_get_return_code(thread));