| 204 | } |
| 205 | |
| 206 | static void test_idle_hook(void) |
| 207 | { |
| 208 | rt_err_t ret_startup = -RT_ERROR; |
| 209 | |
| 210 | rt_thread_idle_sethook(idle_hook); |
| 211 | |
| 212 | tid4 = rt_thread_create("thread4", |
| 213 | thread4_entry, |
| 214 | RT_NULL, |
| 215 | THREAD_STACK_SIZE, |
| 216 | UTEST_THR_PRIORITY - 1, |
| 217 | THREAD_TIMESLICE); |
| 218 | if (tid4 == RT_NULL) |
| 219 | { |
| 220 | LOG_E("rt_thread_create failed!"); |
| 221 | uassert_false(tid4 == RT_NULL); |
| 222 | goto __exit; |
| 223 | } |
| 224 | |
| 225 | ret_startup = rt_thread_startup(tid4); |
| 226 | if (ret_startup != RT_EOK) |
| 227 | { |
| 228 | LOG_E("rt_thread_startup failed!"); |
| 229 | uassert_false(1); |
| 230 | goto __exit; |
| 231 | } |
| 232 | |
| 233 | while (tid4_finish_flag != 1) |
| 234 | { |
| 235 | rt_thread_mdelay(200); |
| 236 | } |
| 237 | uassert_true(entry_idle_hook_times > 0); |
| 238 | |
| 239 | __exit: |
| 240 | return; |
| 241 | } |
| 242 | |
| 243 | static void thread5_entry(void *parameter) |
| 244 | { |
nothing calls this directly
no test coverage detected