Welcome to mirror list, hosted at ThFree Co, Russian Federation.

minunit_test.c « tests « applications - github.com/ClusterM/flipperzero-firmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1e71fd077deb8e6c9bfa8b70de7aae98e2ed8dba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <stdio.h>
#include <furi.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);

    return MU_EXIT_CODE;
}