diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-09-09 10:01:06 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-09-21 08:59:33 +0200 |
commit | 6ae309ec85845f05a6143ade79d6f67bc6898df6 (patch) | |
tree | 93656b0cf6ecceeb0c18dbf2ca03f3deaf73b725 | |
parent | score: Manage scheduler nodes via thread queues (diff) | |
download | rtems-6ae309ec85845f05a6143ade79d6f67bc6898df6.tar.bz2 |
smptests/smpmutex01: Use test case functions
-rw-r--r-- | testsuites/smptests/smpmutex01/init.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/testsuites/smptests/smpmutex01/init.c b/testsuites/smptests/smpmutex01/init.c index 93c059e6fc..c6b1b48c9d 100644 --- a/testsuites/smptests/smpmutex01/init.c +++ b/testsuites/smptests/smpmutex01/init.c @@ -215,9 +215,8 @@ static void worker(rtems_task_argument arg) } } -static void test(void) +static void test_init(test_context *ctx) { - test_context *ctx = &test_instance; rtems_status_code sc; ctx->tasks[M] = rtems_task_self(); @@ -238,7 +237,10 @@ static void test(void) &ctx->mtx ); rtems_test_assert(sc == RTEMS_SUCCESSFUL); +} +static void test_simple_inheritance(test_context *ctx) +{ obtain(ctx); request(ctx, A_1, REQ_MTX_OBTAIN); check_generations(ctx, NONE, NONE); @@ -248,7 +250,10 @@ static void test(void) assert_prio(ctx, M, 3); request(ctx, A_1, REQ_MTX_RELEASE); check_generations(ctx, A_1, NONE); +} +static void test_dequeue_order_one_scheduler_instance(test_context *ctx) +{ obtain(ctx); request(ctx, A_2_0, REQ_MTX_OBTAIN); request(ctx, A_1, REQ_MTX_OBTAIN); @@ -265,7 +270,10 @@ static void test(void) check_generations(ctx, A_2_0, A_2_1); request(ctx, A_2_1, REQ_MTX_RELEASE); check_generations(ctx, A_2_1, NONE); +} +static void test_simple_boosting(test_context *ctx) +{ obtain(ctx); request(ctx, B_5_0, REQ_MTX_OBTAIN); request(ctx, B_4, REQ_MTX_OBTAIN); @@ -282,7 +290,10 @@ static void test(void) check_generations(ctx, B_5_0, B_5_1); request(ctx, B_5_1, REQ_MTX_RELEASE); check_generations(ctx, B_5_1, NONE); +} +static void test_dequeue_order_two_scheduler_instances(test_context *ctx) +{ obtain(ctx); request(ctx, A_2_0, REQ_MTX_OBTAIN); check_generations(ctx, NONE, NONE); @@ -324,6 +335,17 @@ static void test(void) assert_prio(ctx, B_5_1, 5); } +static void test(void) +{ + test_context *ctx = &test_instance; + + test_init(ctx); + test_simple_inheritance(ctx); + test_dequeue_order_one_scheduler_instance(ctx); + test_simple_boosting(ctx); + test_dequeue_order_two_scheduler_instances(ctx); +} + static void Init(rtems_task_argument arg) { TEST_BEGIN(); |