|
12 | 12 |
|
13 | 13 | #define DETACH_THR_ID 2
|
14 | 14 |
|
15 |
| -#define N_THR_E 3 |
16 |
| -#define N_THR_T 4 |
17 |
| -#define BOUNCES 64 |
| 15 | +#define N_THR_E 3 |
| 16 | +#define N_THR_T 4 |
| 17 | +#define BOUNCES 64 |
18 | 18 | #define ONE_SECOND 1
|
19 | 19 |
|
20 | 20 | /* Macros to test invalid states */
|
21 | 21 | #define PTHREAD_CANCEL_INVALID -1
|
22 |
| -#define SCHED_INVALID -1 |
23 |
| -#define PRIO_INVALID -1 |
24 |
| -#define PTHREAD_INVALID -1 |
| 22 | +#define SCHED_INVALID -1 |
| 23 | +#define PRIO_INVALID -1 |
| 24 | +#define PTHREAD_INVALID -1 |
25 | 25 |
|
26 | 26 | static void *thread_top_exec(void *p1);
|
27 | 27 | static void *thread_top_term(void *p1);
|
@@ -57,13 +57,13 @@ static int barrier_return[N_THR_E];
|
57 | 57 |
|
58 | 58 | static void *thread_top_exec(void *p1)
|
59 | 59 | {
|
60 |
| - int i, j, id = (int) POINTER_TO_INT(p1); |
| 60 | + int i, j, id = (int)POINTER_TO_INT(p1); |
61 | 61 | int policy;
|
62 | 62 | struct sched_param schedparam;
|
63 | 63 |
|
64 | 64 | pthread_getschedparam(pthread_self(), &policy, &schedparam);
|
65 |
| - printk("Thread %d starting with scheduling policy %d & priority %d\n", |
66 |
| - id, policy, schedparam.sched_priority); |
| 65 | + printk("Thread %d starting with scheduling policy %d & priority %d\n", id, policy, |
| 66 | + schedparam.sched_priority); |
67 | 67 | /* Try a double-lock here to exercise the failing case of
|
68 | 68 | * trylock. We don't support RECURSIVE locks, so this is
|
69 | 69 | * guaranteed to fail.
|
@@ -201,11 +201,9 @@ static void *thread_top_term(void *p1)
|
201 | 201 | "Unable to set thread priority!");
|
202 | 202 |
|
203 | 203 | zassert_false(pthread_getschedparam(self, &policy, &getschedparam),
|
204 |
| - "Unable to get thread priority!"); |
| 204 | + "Unable to get thread priority!"); |
205 | 205 |
|
206 |
| - printk("Thread %d starting with a priority of %d\n", |
207 |
| - id, |
208 |
| - getschedparam.sched_priority); |
| 206 | + printk("Thread %d starting with a priority of %d\n", id, getschedparam.sched_priority); |
209 | 207 |
|
210 | 208 | if (id % 2) {
|
211 | 209 | ret = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
|
@@ -304,8 +302,7 @@ ZTEST(pthread, test_pthread_execution)
|
304 | 302 | zassert_false(ret, "Set thread name failed!");
|
305 | 303 |
|
306 | 304 | /* TESTPOINT: Try getting thread name */
|
307 |
| - ret = pthread_getname_np(newthread[0], thr_name_buf, |
308 |
| - sizeof(thr_name_buf)); |
| 305 | + ret = pthread_getname_np(newthread[0], thr_name_buf, sizeof(thr_name_buf)); |
309 | 306 | zassert_false(ret, "Get thread name failed!");
|
310 | 307 |
|
311 | 308 | /* TESTPOINT: Thread names match */
|
@@ -460,57 +457,6 @@ ZTEST(pthread, test_pthread_descriptor_leak)
|
460 | 457 | }
|
461 | 458 | }
|
462 | 459 |
|
463 |
| -ZTEST(pthread, test_sched_getparam) |
464 |
| -{ |
465 |
| - struct sched_param param; |
466 |
| - int rc = sched_getparam(0, ¶m); |
467 |
| - int err = errno; |
468 |
| - |
469 |
| - zassert_true((rc == -1 && err == ENOSYS)); |
470 |
| -} |
471 |
| - |
472 |
| -ZTEST(pthread, test_sched_getscheduler) |
473 |
| -{ |
474 |
| - int rc = sched_getscheduler(0); |
475 |
| - int err = errno; |
476 |
| - |
477 |
| - zassert_true((rc == -1 && err == ENOSYS)); |
478 |
| -} |
479 |
| -ZTEST(pthread, test_sched_setparam) |
480 |
| -{ |
481 |
| - struct sched_param param = { |
482 |
| - .sched_priority = 2, |
483 |
| - }; |
484 |
| - int rc = sched_setparam(0, ¶m); |
485 |
| - int err = errno; |
486 |
| - |
487 |
| - zassert_true((rc == -1 && err == ENOSYS)); |
488 |
| -} |
489 |
| - |
490 |
| -ZTEST(pthread, test_sched_setscheduler) |
491 |
| -{ |
492 |
| - struct sched_param param = { |
493 |
| - .sched_priority = 2, |
494 |
| - }; |
495 |
| - int policy = 0; |
496 |
| - int rc = sched_setscheduler(0, policy, ¶m); |
497 |
| - int err = errno; |
498 |
| - |
499 |
| - zassert_true((rc == -1 && err == ENOSYS)); |
500 |
| -} |
501 |
| - |
502 |
| -ZTEST(pthread, test_sched_rr_get_interval) |
503 |
| -{ |
504 |
| - struct timespec interval = { |
505 |
| - .tv_sec = 0, |
506 |
| - .tv_nsec = 0, |
507 |
| - }; |
508 |
| - int rc = sched_rr_get_interval(0, &interval); |
509 |
| - int err = errno; |
510 |
| - |
511 |
| - zassert_true((rc == -1 && err == ENOSYS)); |
512 |
| -} |
513 |
| - |
514 | 460 | ZTEST(pthread, test_pthread_equal)
|
515 | 461 | {
|
516 | 462 | zassert_true(pthread_equal(pthread_self(), pthread_self()));
|
|
0 commit comments