| 204 | } |
| 205 | |
| 206 | static int |
| 207 | test_thread_attributes_priority(void) |
| 208 | { |
| 209 | rte_thread_t thread_id; |
| 210 | rte_thread_attr_t attr; |
| 211 | enum rte_thread_priority priority; |
| 212 | |
| 213 | RTE_TEST_ASSERT(rte_thread_attr_init(&attr) == 0, |
| 214 | "Failed to initialize thread attributes"); |
| 215 | RTE_TEST_ASSERT(rte_thread_attr_set_priority(&attr, RTE_THREAD_PRIORITY_NORMAL) == 0, |
| 216 | "Failed to set thread attributes priority"); |
| 217 | |
| 218 | thread_id_ready = 0; |
| 219 | RTE_TEST_ASSERT(rte_thread_create(&thread_id, &attr, thread_main, NULL) == 0, |
| 220 | "Failed to create attributes priority thread."); |
| 221 | |
| 222 | while (__atomic_load_n(&thread_id_ready, __ATOMIC_ACQUIRE) == 0) |
| 223 | ; |
| 224 | |
| 225 | RTE_TEST_ASSERT(rte_thread_get_priority(thread_id, &priority) == 0, |
| 226 | "Failed to get thread priority"); |
| 227 | RTE_TEST_ASSERT(priority == RTE_THREAD_PRIORITY_NORMAL, |
| 228 | "Failed to apply priority attributes"); |
| 229 | |
| 230 | __atomic_store_n(&thread_id_ready, 2, __ATOMIC_RELEASE); |
| 231 | |
| 232 | return 0; |
| 233 | } |
| 234 | |
| 235 | static int |
| 236 | test_thread_control_create_join(void) |
nothing calls this directly
no test coverage detected