[PATCH] score: Fix _Thread_Cancel()

Sebastian Huber sebastian.huber at embedded-brains.de
Thu May 20 15:40:09 UTC 2021


On 20/05/2021 17:35, Joel Sherrill wrote:
> 
> 
> On Thu, May 20, 2021, 10:33 AM Sebastian Huber 
> <sebastian.huber at embedded-brains.de 
> <mailto:sebastian.huber at embedded-brains.de>> wrote:
> 
>     On 20/05/2021 17:30, Joel Sherrill wrote:
>      > Is there a test case for this situation?
> 
>     Not in the current test suite. I write currently the specification for
>     rtems_task_restart() and the validation tests. My plan is to start with
>     the integration of the new validation test suites after they are
>     finished in Q3 this year.
> 
> 
> Ok.
> 
> Fwiw there are a number of places where score coverage is missing a d 
> needs attention

The table based specification approach covers a lot of cases and paths 
through the code. I think we will get MC/DC at source code level (not 
binary code level) for most functions (maybe except some thread queue 
code). For example, the rtems_task_restart() work in progress table 
looks currently like this:

Status = Ok, FatalError = Nop, Argument = Set, Scheduler = Nop, 
RestartExtensions = Yes

     * Id = Executing, Dormant = No, Suspended = No, Restarting = { Yes, 
No }, Terminating = { No, Yes }, Protected = { Yes, No }, Context = 
Task, State = Ready, Timer = Inactive, RealPriority = Initial, 
ThreadDispatch = Enabled

Status = Ok, FatalError = Nop, Argument = Set, Scheduler = 
UpdatePriority, RestartExtensions = Yes

     * Id = Executing, Dormant = No, Suspended = No, Restarting = { Yes, 
No }, Terminating = { No, Yes }, Protected = { Yes, No }, Context = 
Task, State = Ready, Timer = Inactive, RealPriority = Changed, 
ThreadDispatch = Enabled

Status = Ok, FatalError = Nop, Argument = Set, Scheduler = Unblock, 
RestartExtensions = Yes

     * Id = Executing, Dormant = No, Suspended = Yes, Restarting = { 
Yes, No }, Terminating = { No, Yes }, Protected = { Yes, No }, Context = 
Task, State = Ready, Timer = Inactive, RealPriority = Initial, 
ThreadDispatch = Enabled

Status = Ok, FatalError = Nop, Argument = Set, Scheduler = 
UnblockUpdatePriority, RestartExtensions = Yes

     * Id = Executing, Dormant = No, Suspended = Yes, Restarting = { 
Yes, No }, Terminating = { No, Yes }, Protected = { Yes, No }, Context = 
Task, State = Ready, Timer = Inactive, RealPriority = Changed, 
ThreadDispatch = Enabled

Status = NA, FatalError = Yes, Argument = NA, Scheduler = Nop, 
RestartExtensions = Nop

     * Id = Executing, Dormant = No, Suspended = { No, Yes }, Restarting 
= { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, No }, 
Context = Task, State = Ready, Timer = Inactive, RealPriority = { 
Initial, Changed }, ThreadDispatch = Disabled

Status = Ok, FatalError = Nop, Argument = Set, Scheduler = Nop, 
RestartExtensions = Nop

     * Id = { Other, Executing }, Dormant = No, Suspended = No, 
Restarting = { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, 
No }, Context = Interrupt, State = { Enqueued, Blocked }, Timer = { 
Active, Inactive }, RealPriority = Initial, ThreadDispatch = Disabled

     * Id = { Other, Executing }, Dormant = No, Suspended = No, 
Restarting = { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, 
No }, Context = Interrupt, State = Ready, Timer = Inactive, RealPriority 
= Initial, ThreadDispatch = Disabled

     * Id = Other, Dormant = No, Suspended = No, Restarting = { Yes, No 
}, Terminating = { No, Yes }, Protected = { Yes, No }, Context = Task, 
State = { Enqueued, Blocked }, Timer = { Active, Inactive }, 
RealPriority = Initial, ThreadDispatch = { Enabled, Disabled }

     * Id = Other, Dormant = No, Suspended = No, Restarting = { Yes, No 
}, Terminating = { No, Yes }, Protected = { Yes, No }, Context = Task, 
State = Ready, Timer = Inactive, RealPriority = Initial, ThreadDispatch 
= { Enabled, Disabled }

Status = Ok, FatalError = Nop, Argument = Set, Scheduler = 
UpdatePriority, RestartExtensions = Nop

     * Id = { Other, Executing }, Dormant = No, Suspended = No, 
Restarting = { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, 
No }, Context = Interrupt, State = { Enqueued, Blocked }, Timer = { 
Active, Inactive }, RealPriority = Changed, ThreadDispatch = Disabled

     * Id = { Other, Executing }, Dormant = No, Suspended = No, 
Restarting = { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, 
No }, Context = Interrupt, State = Ready, Timer = Inactive, RealPriority 
= Changed, ThreadDispatch = Disabled

     * Id = Other, Dormant = No, Suspended = No, Restarting = { Yes, No 
}, Terminating = { No, Yes }, Protected = { Yes, No }, Context = Task, 
State = { Enqueued, Blocked }, Timer = { Active, Inactive }, 
RealPriority = Changed, ThreadDispatch = { Enabled, Disabled }

     * Id = Other, Dormant = No, Suspended = No, Restarting = { Yes, No 
}, Terminating = { No, Yes }, Protected = { Yes, No }, Context = Task, 
State = Ready, Timer = Inactive, RealPriority = Changed, ThreadDispatch 
= { Enabled, Disabled }

Status = Ok, FatalError = Nop, Argument = Set, Scheduler = Unblock, 
RestartExtensions = Nop

     * Id = { Other, Executing }, Dormant = No, Suspended = Yes, 
Restarting = { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, 
No }, Context = Interrupt, State = { Enqueued, Blocked }, Timer = { 
Active, Inactive }, RealPriority = Initial, ThreadDispatch = Disabled

     * Id = { Other, Executing }, Dormant = No, Suspended = Yes, 
Restarting = { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, 
No }, Context = Interrupt, State = Ready, Timer = Inactive, RealPriority 
= Initial, ThreadDispatch = Disabled

     * Id = Other, Dormant = No, Suspended = Yes, Restarting = { Yes, No 
}, Terminating = { No, Yes }, Protected = { Yes, No }, Context = Task, 
State = { Enqueued, Blocked }, Timer = { Active, Inactive }, 
RealPriority = Initial, ThreadDispatch = { Enabled, Disabled }

     * Id = Other, Dormant = No, Suspended = Yes, Restarting = { Yes, No 
}, Terminating = { No, Yes }, Protected = { Yes, No }, Context = Task, 
State = Ready, Timer = Inactive, RealPriority = Initial, ThreadDispatch 
= { Enabled, Disabled }

Status = Ok, FatalError = Nop, Argument = Set, Scheduler = 
UnblockUpdatePriority, RestartExtensions = Nop

     * Id = { Other, Executing }, Dormant = No, Suspended = Yes, 
Restarting = { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, 
No }, Context = Interrupt, State = { Enqueued, Blocked }, Timer = { 
Active, Inactive }, RealPriority = Changed, ThreadDispatch = Disabled

     * Id = { Other, Executing }, Dormant = No, Suspended = Yes, 
Restarting = { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, 
No }, Context = Interrupt, State = Ready, Timer = Inactive, RealPriority 
= Changed, ThreadDispatch = Disabled

     * Id = Other, Dormant = No, Suspended = Yes, Restarting = { Yes, No 
}, Terminating = { No, Yes }, Protected = { Yes, No }, Context = Task, 
State = { Enqueued, Blocked }, Timer = { Active, Inactive }, 
RealPriority = Changed, ThreadDispatch = { Enabled, Disabled }

     * Id = Other, Dormant = No, Suspended = Yes, Restarting = { Yes, No 
}, Terminating = { No, Yes }, Protected = { Yes, No }, Context = Task, 
State = Ready, Timer = Inactive, RealPriority = Changed, ThreadDispatch 
= { Enabled, Disabled }

Status = IncStat, FatalError = Nop, Argument = Nop, Scheduler = Nop, 
RestartExtensions = Nop

     * Id = Other, Dormant = Yes, Suspended = No, Restarting = NA, 
Terminating = { No, Yes }, Protected = NA, Context = Interrupt, State = 
NA, Timer = NA, RealPriority = { Initial, Changed }, ThreadDispatch = 
Disabled

     * Id = Other, Dormant = Yes, Suspended = No, Restarting = NA, 
Terminating = { No, Yes }, Protected = NA, Context = Task, State = NA, 
Timer = NA, RealPriority = { Initial, Changed }, ThreadDispatch = { 
Enabled, Disabled }

     * Id = Other, Dormant = Yes, Suspended = { No, Yes }, Restarting = 
NA, Terminating = Yes, Protected = NA, Context = Task, State = NA, Timer 
= NA, RealPriority = { Initial, Changed }, ThreadDispatch = { Enabled, 
Disabled }

     * Id = Other, Dormant = Yes, Suspended = Yes, Restarting = NA, 
Terminating = { No, Yes }, Protected = NA, Context = Interrupt, State = 
NA, Timer = NA, RealPriority = { Initial, Changed }, ThreadDispatch = 
Disabled

     * Id = Other, Dormant = Yes, Suspended = Yes, Restarting = NA, 
Terminating = No, Protected = NA, Context = Task, State = NA, Timer = 
NA, RealPriority = { Initial, Changed }, ThreadDispatch = { Enabled, 
Disabled }

Status = InvId, FatalError = Nop, Argument = Nop, Scheduler = Nop, 
RestartExtensions = Nop

     * Id = Invalid, Dormant = NA, Suspended = NA, Restarting = NA, 
Terminating = NA, Protected = NA, Context = Interrupt, State = NA, Timer 
= NA, RealPriority = NA, ThreadDispatch = Disabled

     * Id = Invalid, Dormant = NA, Suspended = NA, Restarting = NA, 
Terminating = NA, Protected = NA, Context = Task, State = NA, Timer = 
NA, RealPriority = NA, ThreadDispatch = { Enabled, Disabled }

ExecutingIsNotDormant

     * Id = Executing, Dormant = Yes, Suspended = { No, Yes }, 
Restarting = { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, 
No }, Context = Interrupt, State = { Enqueued, Blocked, Ready }, Timer = 
{ Active, Inactive }, RealPriority = { Initial, Changed }, 
ThreadDispatch = Disabled

     * Id = Executing, Dormant = Yes, Suspended = { No, Yes }, 
Restarting = { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, 
No }, Context = Task, State = { Enqueued, Blocked, Ready }, Timer = { 
Active, Inactive }, RealPriority = { Initial, Changed }, ThreadDispatch 
= { Enabled, Disabled }

ExecutingIsNotBlocked

     * Id = Executing, Dormant = No, Suspended = { No, Yes }, Restarting 
= { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, No }, 
Context = Task, State = { Enqueued, Blocked }, Timer = { Active, 
Inactive }, RealPriority = { Initial, Changed }, ThreadDispatch = { 
Enabled, Disabled }

NotBlockedHasInactiveTimer

     * Id = { Other, Executing }, Dormant = No, Suspended = { No, Yes }, 
Restarting = { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, 
No }, Context = Interrupt, State = Ready, Timer = Active, RealPriority = 
{ Initial, Changed }, ThreadDispatch = Disabled

     * Id = { Other, Executing }, Dormant = No, Suspended = { No, Yes }, 
Restarting = { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, 
No }, Context = Task, State = Ready, Timer = Active, RealPriority = { 
Initial, Changed }, ThreadDispatch = { Enabled, Disabled }

ISRThreadDispatchDisabled

     * Id = { Other, Invalid, Executing }, Dormant = { No, Yes }, 
Suspended = { No, Yes }, Restarting = { Yes, No }, Terminating = { No, 
Yes }, Protected = { Yes, No }, Context = Interrupt, State = { Enqueued, 
Blocked, Ready }, Timer = { Active, Inactive }, RealPriority = { 
Initial, Changed }, ThreadDispatch = Enabled

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list