| 96 | } |
| 97 | |
| 98 | static void test_static_thread(void) |
| 99 | { |
| 100 | rt_err_t ret_init = -RT_ERROR; |
| 101 | rt_err_t ret_startup = -RT_ERROR; |
| 102 | rt_err_t ret_detach = -RT_ERROR; |
| 103 | |
| 104 | ret_init = rt_thread_init(&thread2, |
| 105 | "thread2", |
| 106 | thread2_entry, |
| 107 | (void *)2, |
| 108 | &thread2_stack[0], |
| 109 | sizeof(thread2_stack), |
| 110 | UTEST_THR_PRIORITY + 1, |
| 111 | THREAD_TIMESLICE); |
| 112 | if (ret_init != RT_EOK) |
| 113 | { |
| 114 | uassert_false(ret_init != RT_EOK); |
| 115 | goto __exit; |
| 116 | } |
| 117 | |
| 118 | ret_startup = rt_thread_startup(&thread2); |
| 119 | if (ret_startup != RT_EOK) |
| 120 | { |
| 121 | uassert_false(ret_startup != RT_EOK); |
| 122 | goto __exit; |
| 123 | } |
| 124 | |
| 125 | ret_detach = rt_thread_detach(&thread2); |
| 126 | if (ret_detach != RT_EOK) |
| 127 | { |
| 128 | uassert_false(ret_detach != RT_EOK); |
| 129 | goto __exit; |
| 130 | } |
| 131 | |
| 132 | uassert_true(ret_init == RT_EOK && ret_startup == RT_EOK && ret_detach == RT_EOK); |
| 133 | |
| 134 | __exit: |
| 135 | if (ret_init == RT_EOK && ret_detach != RT_EOK) |
| 136 | { |
| 137 | rt_thread_detach(&thread2); |
| 138 | } |
| 139 | return; |
| 140 | } |
| 141 | |
| 142 | static void thread3_entry(void *parameter) |
| 143 | { |
nothing calls this directly
no test coverage detected