MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / test_static_mutex_init

Function test_static_mutex_init

src/utest/mutex_tc.c:32–61  ·  view source on GitHub ↗

init test */

Source from the content-addressed store, hash-verified

30
31/* init test */
32static void test_static_mutex_init(void)
33{
34 rt_err_t result = -RT_ERROR;
35
36 result = rt_mutex_init(&static_mutex, "static_mutex", RT_IPC_FLAG_PRIO);
37 if (RT_EOK != result)
38 {
39 uassert_true(RT_FALSE);
40 }
41
42 result = rt_mutex_detach(&static_mutex);
43 if (RT_EOK != result)
44 {
45 uassert_true(RT_FALSE);
46 }
47
48 result = rt_mutex_init(&static_mutex, "static_mutex", RT_IPC_FLAG_PRIO);
49 if (RT_EOK != result)
50 {
51 uassert_true(RT_FALSE);
52 }
53
54 result = rt_mutex_detach(&static_mutex);
55 if (RT_EOK != result)
56 {
57 uassert_true(RT_FALSE);
58 }
59
60 uassert_true(RT_TRUE);
61}
62
63/* static take test */
64static void static_mutex_take_entry(void *param)

Callers

nothing calls this directly

Calls 2

rt_mutex_initFunction · 0.85
rt_mutex_detachFunction · 0.85

Tested by

no test coverage detected