[rtems-central commit] spec: Test thread queue API change
Sebastian Huber
sebh at rtems.org
Fri Sep 24 11:32:07 UTC 2021
Module: rtems-central
Branch: master
Commit: e3a2b9fbd2245271e0a0e02a2408665fe737ded9
Changeset: http://git.rtems.org/rtems-central/commit/?id=e3a2b9fbd2245271e0a0e02a2408665fe737ded9
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Wed Sep 22 10:48:26 2021 +0200
spec: Test thread queue API change
---
spec/rtems/sem/req/obtain.yml | 2 +-
spec/score/tq/req/enqueue-ceiling.yml | 13 ++----
spec/score/tq/req/enqueue-deadlock.yml | 7 +---
spec/score/tq/req/enqueue-mrsp.yml | 55 ++++----------------------
spec/score/tq/req/enqueue-priority.yml | 12 ++----
spec/score/tq/req/flush-priority-inherit.yml | 20 ++--------
spec/score/tq/req/flush-priority.yml | 6 +--
spec/score/tq/req/timeout-priority-inherit.yml | 6 ---
spec/score/tq/req/timeout.yml | 7 +---
9 files changed, 23 insertions(+), 105 deletions(-)
diff --git a/spec/rtems/sem/req/obtain.yml b/spec/rtems/sem/req/obtain.yml
index b14eb66..b40cf1f 100644
--- a/spec/rtems/sem/req/obtain.yml
+++ b/spec/rtems/sem/req/obtain.yml
@@ -216,7 +216,7 @@ test-action: |
sc = rtems_semaphore_set_priority(
ctx->tq_ctx.thread_queue_id,
- ctx->tq_ctx.other_scheduler_id,
+ SCHEDULER_B_ID,
PRIO_VERY_HIGH,
&prio
);
diff --git a/spec/score/tq/req/enqueue-ceiling.yml b/spec/score/tq/req/enqueue-ceiling.yml
index 9d68393..a990665 100644
--- a/spec/score/tq/req/enqueue-ceiling.yml
+++ b/spec/score/tq/req/enqueue-ceiling.yml
@@ -192,10 +192,10 @@ test-action: |
if ( ctx->helping ) {
if ( ctx->other_before || ctx->other_after ) {
if ( rtems_scheduler_get_processor_maximum() > 2 ) {
- AddHelper( ctx->tq_ctx, ctx->tq_ctx->third_scheduler_id );
+ AddHelper( ctx->tq_ctx, SCHEDULER_C_ID );
}
} else {
- AddHelper( ctx->tq_ctx, ctx->tq_ctx->other_scheduler_id );
+ AddHelper( ctx->tq_ctx, SCHEDULER_B_ID );
}
}
@@ -283,17 +283,12 @@ test-setup:
code: |
rtems_id scheduler_id;
- scheduler_id = ctx->tq_ctx->runner_scheduler_id;
+ scheduler_id = SCHEDULER_A_ID;
TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_A, scheduler_id, PRIO_VERY_HIGH );
TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_B, scheduler_id, PRIO_VERY_HIGH );
TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_C, scheduler_id, PRIO_VERY_HIGH );
#if defined( RTEMS_SMP )
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_BLOCKER_D,
- ctx->tq_ctx->other_scheduler_id,
- PRIO_LOW
- );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_D, SCHEDULER_B_ID, PRIO_LOW );
#endif
description: null
test-stop: null
diff --git a/spec/score/tq/req/enqueue-deadlock.yml b/spec/score/tq/req/enqueue-deadlock.yml
index 1b89528..057b905 100644
--- a/spec/score/tq/req/enqueue-deadlock.yml
+++ b/spec/score/tq/req/enqueue-deadlock.yml
@@ -134,12 +134,7 @@ test-action: |
TQ_EVENT_SURRENDER | TQ_EVENT_RUNNER_SYNC
);
TQSynchronizeRunner();
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_BLOCKER_A,
- ctx->tq_ctx->runner_scheduler_id,
- PRIO_HIGH
- );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_A, SCHEDULER_A_ID, PRIO_HIGH );
} else {
TQSend( ctx->tq_ctx, TQ_BLOCKER_A, TQ_EVENT_SURRENDER );
}
diff --git a/spec/score/tq/req/enqueue-mrsp.yml b/spec/score/tq/req/enqueue-mrsp.yml
index 2708cab..9adeb8c 100644
--- a/spec/score/tq/req/enqueue-mrsp.yml
+++ b/spec/score/tq/req/enqueue-mrsp.yml
@@ -310,45 +310,17 @@ test-setup:
brief: null
code: |
if ( CanDoFullValidation() ) {
- rtems_status_code sc;
-
- sc = rtems_scheduler_remove_processor(
- ctx->tq_ctx->third_scheduler_id,
- 2
- );
- T_rsc_success( sc );
-
- sc = rtems_scheduler_add_processor(
- ctx->tq_ctx->other_scheduler_id,
- 2
- );
- T_rsc_success( sc );
-
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_BLOCKER_C,
- ctx->tq_ctx->third_scheduler_id,
- PRIO_LOW
- );
+ RemoveProcessor( SCHEDULER_C_ID, 2 );
+ AddProcessor( SCHEDULER_B_ID, 2 );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_C, SCHEDULER_C_ID, PRIO_LOW );
}
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_BLOCKER_A,
- ctx->tq_ctx->other_scheduler_id,
- PRIO_LOW
- );
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_BLOCKER_B,
- ctx->tq_ctx->other_scheduler_id,
- PRIO_LOW
- );
-
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_A, SCHEDULER_B_ID, PRIO_LOW );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_B, SCHEDULER_B_ID, PRIO_LOW );
TQSetScheduler(
ctx->tq_ctx,
TQ_BLOCKER_D,
- ctx->tq_ctx->runner_scheduler_id,
+ SCHEDULER_A_ID,
PRIO_ULTRA_HIGH
);
description: null
@@ -369,19 +341,8 @@ test-teardown:
brief: null
code: |
if ( CanDoFullValidation() ) {
- rtems_status_code sc;
-
- sc = rtems_scheduler_remove_processor(
- ctx->tq_ctx->other_scheduler_id,
- 2
- );
- T_rsc_success( sc );
-
- sc = rtems_scheduler_add_processor(
- ctx->tq_ctx->third_scheduler_id,
- 2
- );
- T_rsc_success( sc );
+ RemoveProcessor( SCHEDULER_B_ID, 2 );
+ AddProcessor( SCHEDULER_C_ID, 2 );
}
TQReset( ctx->tq_ctx );
diff --git a/spec/score/tq/req/enqueue-priority.yml b/spec/score/tq/req/enqueue-priority.yml
index 306d996..8449230 100644
--- a/spec/score/tq/req/enqueue-priority.yml
+++ b/spec/score/tq/req/enqueue-priority.yml
@@ -228,10 +228,10 @@ test-action: |
if ( ctx->helping ) {
if ( ctx->other_before || ctx->other_after ) {
if ( rtems_scheduler_get_processor_maximum() > 2 ) {
- AddHelper( ctx->tq_ctx, ctx->tq_ctx->third_scheduler_id );
+ AddHelper( ctx->tq_ctx, SCHEDULER_C_ID );
}
} else {
- AddHelper( ctx->tq_ctx, ctx->tq_ctx->other_scheduler_id );
+ AddHelper( ctx->tq_ctx, SCHEDULER_B_ID );
}
}
@@ -314,17 +314,13 @@ test-prepare:
test-setup:
brief: null
code: |
+ TQReset( ctx->tq_ctx );
TQSetPriority( ctx->tq_ctx, TQ_BLOCKER_A, PRIO_ULTRA_HIGH );
TQSetPriority( ctx->tq_ctx, TQ_BLOCKER_B, PRIO_LOW );
TQSetPriority( ctx->tq_ctx, TQ_BLOCKER_C, PRIO_VERY_HIGH );
#if defined( RTEMS_SMP )
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_BLOCKER_D,
- ctx->tq_ctx->other_scheduler_id,
- PRIO_LOW
- );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_D, SCHEDULER_B_ID, PRIO_LOW );
#endif
description: null
test-stop: null
diff --git a/spec/score/tq/req/flush-priority-inherit.yml b/spec/score/tq/req/flush-priority-inherit.yml
index eef2856..ad070b9 100644
--- a/spec/score/tq/req/flush-priority-inherit.yml
+++ b/spec/score/tq/req/flush-priority-inherit.yml
@@ -134,18 +134,9 @@ test-action: |
if ( ctx->tq_ctx->how_many > 0 ) {
if ( ctx->minimum ) {
if ( rtems_configuration_get_maximum_processors() > 1 ) {
- TQSetScheduler(
- ctx->tq_ctx, TQ_BLOCKER_B,
- ctx->tq_ctx->other_scheduler_id,
- PRIO_HIGH
- );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_B, SCHEDULER_B_ID, PRIO_HIGH );
} else {
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_BLOCKER_B,
- ctx->tq_ctx->runner_scheduler_id,
- PRIO_HIGH
- );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_B, SCHEDULER_A_ID, PRIO_HIGH );
}
TQSetPriority( ctx->tq_ctx, TQ_BLOCKER_C, PRIO_VERY_HIGH );
@@ -153,12 +144,7 @@ test-action: |
TQSend( ctx->tq_ctx, TQ_BLOCKER_C, TQ_EVENT_ENQUEUE );
TQSend( ctx->tq_ctx, TQ_BLOCKER_D, TQ_EVENT_ENQUEUE );
} else {
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_BLOCKER_B,
- ctx->tq_ctx->runner_scheduler_id,
- PRIO_HIGH
- );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_B, SCHEDULER_A_ID, PRIO_HIGH );
TQSetPriority( ctx->tq_ctx, TQ_BLOCKER_C, PRIO_HIGH );
TQSetPriority( ctx->tq_ctx, TQ_BLOCKER_D, PRIO_HIGH );
diff --git a/spec/score/tq/req/flush-priority.yml b/spec/score/tq/req/flush-priority.yml
index c4bb20c..7e5ac0c 100644
--- a/spec/score/tq/req/flush-priority.yml
+++ b/spec/score/tq/req/flush-priority.yml
@@ -130,11 +130,7 @@ test-setup:
ctx->supports_multiple_priority_queues &&
rtems_configuration_get_maximum_processors() > 1
) {
- TQSetScheduler(
- ctx->tq_ctx, TQ_BLOCKER_B,
- ctx->tq_ctx->other_scheduler_id,
- PRIO_HIGH
- );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_B, SCHEDULER_B_ID, PRIO_HIGH );
} else {
TQSetPriority( ctx->tq_ctx, TQ_BLOCKER_B, PRIO_HIGH );
}
diff --git a/spec/score/tq/req/timeout-priority-inherit.yml b/spec/score/tq/req/timeout-priority-inherit.yml
index 9d96378..50486d2 100644
--- a/spec/score/tq/req/timeout-priority-inherit.yml
+++ b/spec/score/tq/req/timeout-priority-inherit.yml
@@ -267,12 +267,6 @@ test-setup:
code: |
ctx->request.arg = ctx;
TQReset( ctx->tq_ctx );
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_HELPER_OTHER,
- SCHEDULER_A_ID,
- PRIO_NORMAL
- );
description: null
test-stop: null
test-support: |
diff --git a/spec/score/tq/req/timeout.yml b/spec/score/tq/req/timeout.yml
index a0aa387..ca071b7 100644
--- a/spec/score/tq/req/timeout.yml
+++ b/spec/score/tq/req/timeout.yml
@@ -128,12 +128,7 @@ test-setup:
TQReset( ctx->tq_ctx );
if ( ctx->tq_ctx->enqueue_variant == TQ_ENQUEUE_STICKY ) {
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_BLOCKER_A,
- ctx->tq_ctx->other_scheduler_id,
- PRIO_NORMAL
- );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_A, SCHEDULER_B_ID, PRIO_NORMAL );
} else {
TQSetPriority( ctx->tq_ctx, TQ_BLOCKER_A, PRIO_HIGH );
}
More information about the vc
mailing list