tests: mslab_concept: fix code style

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2017-06-16 21:32:28 -04:00 committed by Kumar Gala
commit a9da45a200
2 changed files with 9 additions and 9 deletions

View file

@ -11,7 +11,7 @@ extern void test_mslab_alloc_wait_prio(void);
void test_main(void *p1, void *p2, void *p3) void test_main(void *p1, void *p2, void *p3)
{ {
ztest_test_suite(test_mslab_concept, ztest_test_suite(test_mslab_concept,
ztest_unit_test(test_mslab_alloc_wait_prio)); ztest_unit_test(test_mslab_alloc_wait_prio));
ztest_run_test_suite(test_mslab_concept); ztest_run_test_suite(test_mslab_concept);
} }

View file

@ -45,7 +45,7 @@ void tmslab_alloc_wait_timeout(void *p1, void *p2, void *p3)
void *block; void *block;
zassert_true(k_mem_slab_alloc(&mslab1, &block, TIMEOUT) == -EAGAIN, zassert_true(k_mem_slab_alloc(&mslab1, &block, TIMEOUT) == -EAGAIN,
NULL); NULL);
k_sem_give(&sync_sema); k_sem_give(&sync_sema);
} }
@ -65,7 +65,7 @@ void test_mslab_alloc_wait_prio(void)
/*allocated up all blocks*/ /*allocated up all blocks*/
for (int i = 0; i < BLK_NUM; i++) { for (int i = 0; i < BLK_NUM; i++) {
zassert_equal(k_mem_slab_alloc(&mslab1, &block[i], K_NO_WAIT), zassert_equal(k_mem_slab_alloc(&mslab1, &block[i], K_NO_WAIT),
0, NULL); 0, NULL);
} }
/** /**
@ -79,16 +79,16 @@ void test_mslab_alloc_wait_prio(void)
*/ */
/*the low-priority thread*/ /*the low-priority thread*/
tid[0] = k_thread_create(&tdata[0], tstack[0], STACK_SIZE, tid[0] = k_thread_create(&tdata[0], tstack[0], STACK_SIZE,
tmslab_alloc_wait_timeout, NULL, NULL, NULL, tmslab_alloc_wait_timeout, NULL, NULL, NULL,
K_PRIO_PREEMPT(1), 0, 0); K_PRIO_PREEMPT(1), 0, 0);
/*the highest-priority thread that has waited the longest*/ /*the highest-priority thread that has waited the longest*/
tid[1] = k_thread_create(&tdata[1], tstack[1], STACK_SIZE, tid[1] = k_thread_create(&tdata[1], tstack[1], STACK_SIZE,
tmslab_alloc_wait_ok, NULL, NULL, NULL, tmslab_alloc_wait_ok, NULL, NULL, NULL,
K_PRIO_PREEMPT(0), 0, 10); K_PRIO_PREEMPT(0), 0, 10);
/*the highest-priority thread that has waited shorter*/ /*the highest-priority thread that has waited shorter*/
tid[2] = k_thread_create(&tdata[2], tstack[2], STACK_SIZE, tid[2] = k_thread_create(&tdata[2], tstack[2], STACK_SIZE,
tmslab_alloc_wait_timeout, NULL, NULL, NULL, tmslab_alloc_wait_timeout, NULL, NULL, NULL,
K_PRIO_PREEMPT(0), 0, 20); K_PRIO_PREEMPT(0), 0, 20);
/*relinquish CPU for above threads to start */ /*relinquish CPU for above threads to start */
k_sleep(30); k_sleep(30);
/*free one block, expected to unblock thread "tid[1]"*/ /*free one block, expected to unblock thread "tid[1]"*/