Update SMP unit test to cover prvInitialiseTaskLists (#1151)

* Update SMP unit test to cover prvInitialiseTaskLists
pull/1147/head^2
chinglee-iot 1 year ago committed by GitHub
parent 121fbe295b
commit bd56549a48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -101,6 +101,7 @@ AERR
AESCCM AESCCM
AESCE AESCE
AESCMAC AESCMAC
AESGCM
AESNI AESNI
AESR AESR
AFECR AFECR
@ -307,6 +308,7 @@ BCTRL
BCUT BCUT
BDCR BDCR
BDEV BDEV
BDEVOPENMODE
BDEVTEST BDEVTEST
BDEVTESTPARAM BDEVTESTPARAM
BDFA BDFA
@ -323,6 +325,7 @@ BERR
BESR BESR
BFAR BFAR
BFARV BFARV
BFARVALID
BFHFNMIGN BFHFNMIGN
BFRX BFRX
BFSR BFSR
@ -430,6 +433,7 @@ BUFNA
BUFWREN BUFWREN
BUMEN BUMEN
BUSA BUSA
BUSFAULTENA
BUSFAULTSR BUSFAULTSR
BUSP BUSP
BUSTKE BUSTKE
@ -646,6 +650,7 @@ CLKPR
CLKPS CLKPS
CLKRQ CLKRQ
CLKS CLKS
CLKSOURCE
CLKSR CLKSR
CLKSTA CLKSTA
CLKVCLR CLKVCLR
@ -761,6 +766,7 @@ CPCSTOP
CPCTRG CPCTRG
CPDI CPDI
CPHA CPHA
CPIEVTENA
CPIN CPIN
CPINREADY CPINREADY
CPIV CPIV
@ -862,6 +868,11 @@ CWTA
CWTAVAL CWTAVAL
CWTIF CWTIF
CWUF CWUF
CYCCNT
CYCCNTENA
CYCEVTENA
CYCMATCH
CYCTAP
CYGNAL CYGNAL
Cbmc Cbmc
Centralised Centralised
@ -1491,7 +1502,9 @@ EWRL
EWRX EWRX
EWUP EWUP
EXCC EXCC
EXCEVTENA
EXCOL EXCOL
EXCTRCENA
EXDEF EXDEF
EXEDG EXEDG
EXID EXID
@ -1600,6 +1613,7 @@ FMULTCLK
FMXR FMXR
FNTR FNTR
FNUM FNUM
FOLDEVTENA
FOLVA FOLVA
FOLVB FOLVB
FOOB FOOB
@ -2496,6 +2510,7 @@ MASKH
MASKL MASKL
MAXBLKL MAXBLKL
MAXFS MAXFS
MAXFSIZE
MAXFSSIZE MAXFSSIZE
MAXMB MAXMB
MAXRTX MAXRTX
@ -2570,6 +2585,7 @@ MDTX
MEDEMSR MEDEMSR
MEM MEM
MEMA MEMA
MEMFAULTENA
MEMFAULTSR MEMFAULTSR
MEMP MEMP
MERASE MERASE
@ -2601,6 +2617,7 @@ MISRA
MLAN MLAN
MMAR MMAR
MMARV MMARV
MMARVALID
MMCCR MMCCR
MMCIT MMCIT
MMCR MMCR
@ -2862,6 +2879,7 @@ Nfontname
Ngan Ngan
Nios Nios
Nmap Nmap
Nondet
Npcap Npcap
Nullpuc Nullpuc
Nullpx Nullpx
@ -3253,6 +3271,7 @@ PRFTBS
PRIA PRIA
PRIS PRIS
PRIVDEFEN PRIVDEFEN
PRIVDEFENA
PRKLAST PRKLAST
PRLH PRLH
PRLL PRLL
@ -3611,6 +3630,7 @@ RMEN
RMII RMII
RMIIEN RMIIEN
RMIIMII RMIIMII
RMTAUTH
RMTE RMTE
RMTEN RMTEN
RMUTE RMUTE
@ -3989,6 +4009,8 @@ SECEV
SECP SECP
SECU SECU
SEGGER SEGGER
SELEXTCLK
SELEXTEN
SENDA SENDA
SEQR SEQR
SESREQ SESREQ
@ -4044,6 +4066,8 @@ SLBDIS
SLCKSEL SLCKSEL
SLCR SLCR
SLCT SLCT
SLEEPEVTENA
SLEEPONEXIT
SLEWCTL SLEWCTL
SLICEBY SLICEBY
SLIPIF SLIPIF
@ -4287,6 +4311,7 @@ SYBYPSR
SYMM SYMM
SYNCA SYNCA
SYNCB SYNCB
SYNCENA
SYNCR SYNCR
SYNMAXRTX SYNMAXRTX
SYNSR SYNSR
@ -4524,6 +4549,7 @@ TRAPA
TRARECLENGTH TRARECLENGTH
TRAS TRAS
TRCD TRCD
TRCENA
TRCMD TRCMD
TRCMPAD TRCMPAD
TRCMPAU TRCMPAU
@ -4902,6 +4928,7 @@ USEND
USEPWMDIV USEPWMDIV
USEQ USEQ
USGA USGA
USGFAULTENA
USGFAULTSR USGFAULTSR
USGTRGAF USGTRGAF
USGTRGAR USGTRGAR
@ -4965,6 +4992,8 @@ VDTO
VECT VECT
VECTACTIVE VECTACTIVE
VECTCLRACTIVE VECTCLRACTIVE
VECTKEY
VECTKEYSTAT
VECTPENDING VECTPENDING
VECTRESET VECTRESET
VECTTBL VECTTBL
@ -5141,6 +5170,7 @@ XADD
XAPM XAPM
XAXIPMON XAXIPMON
XBLANK XBLANK
XCALLBACK
XCANPS XCANPS
XCOL XCOL
XCOREAI XCOREAI
@ -5340,6 +5370,7 @@ coalescences
codecov codecov
comms comms
converttounixtime converttounixtime
coreid
coremqtt coremqtt
cortexa cortexa
coverity coverity
@ -5410,6 +5441,7 @@ eqcfg
equalto equalto
equidistribution equidistribution
eret eret
estack
ethernetif ethernetif
etrgs etrgs
evba evba
@ -5596,6 +5628,7 @@ lxip
macaddrhr macaddrhr
macaddrlr macaddrlr
maes maes
maxfsize
maxiosz maxiosz
maxnpacks maxnpacks
mbar mbar
@ -5655,10 +5688,10 @@ mret
mrru mrru
mrseq mrseq
mrsne mrsne
msse
mspgcc mspgcc
msplim msplim
msreq msreq
msse
mstatus mstatus
mstroff mstroff
mtdr mtdr
@ -5689,6 +5722,7 @@ noassert
nocrypt nocrypt
noheap noheap
noint noint
nondet
nopts nopts
nostdint nostdint
notifyzz notifyzz
@ -5868,6 +5902,7 @@ reti
revsh revsh
rgmii rgmii
riscv riscv
rmtauth
rovr rovr
rsar rsar
rslcx rslcx
@ -6018,6 +6053,7 @@ txrx
u u
uadd uadd
uasx uasx
ubasetype
ublock ublock
ublox ublox
uchars uchars
@ -6037,6 +6073,7 @@ unhashed
unifdef unifdef
uninitialised uninitialised
uninitializing uninitializing
unprecise
unsubscriptions unsubscriptions
unsuspended unsuspended
unsuspends unsuspends

@ -113,6 +113,10 @@ extern volatile UBaseType_t uxCurrentNumberOfTasks;
extern volatile UBaseType_t uxSchedulerSuspended; extern volatile UBaseType_t uxSchedulerSuspended;
extern volatile UBaseType_t uxTopReadyPriority; extern volatile UBaseType_t uxTopReadyPriority;
extern List_t pxReadyTasksLists[ configMAX_PRIORITIES ]; extern List_t pxReadyTasksLists[ configMAX_PRIORITIES ];
extern List_t xDelayedTaskList1;
extern List_t xDelayedTaskList2;
extern List_t xTasksWaitingTermination;
extern List_t xSuspendedTaskList;
extern UBaseType_t uxTaskNumber; extern UBaseType_t uxTaskNumber;
extern volatile TickType_t xTickCount; extern volatile TickType_t xTickCount;
extern volatile TickType_t xNextTaskUnblockTime; extern volatile TickType_t xNextTaskUnblockTime;
@ -1125,8 +1129,10 @@ void test_coverage_prvCreateIdleTasks_name_within_max_len( void )
TCB_t * xIdleTask; TCB_t * xIdleTask;
TCB_t xTask = { 0 }; TCB_t xTask = { 0 };
int i; int i;
UBaseType_t uxPriority;
pcIdleTaskName = "IDLE longXX"; pcIdleTaskName = "IDLE longXX";
xSchedulerRunning = pdFALSE;
for( i = 0; i < configNUMBER_OF_CORES; i++ ) for( i = 0; i < configNUMBER_OF_CORES; i++ )
{ {
@ -1141,10 +1147,27 @@ void test_coverage_prvCreateIdleTasks_name_within_max_len( void )
listSET_LIST_ITEM_VALUE_ExpectAnyArgs(); listSET_LIST_ITEM_VALUE_ExpectAnyArgs();
pxPortInitialiseStack_ExpectAnyArgsAndReturn( NULL ); pxPortInitialiseStack_ExpectAnyArgsAndReturn( NULL );
/* prvAddNewTaskToReadyList. */
vFakePortEnterCriticalSection_Expect(); vFakePortEnterCriticalSection_Expect();
/* prvInitialiseTaskLists call when first task is initialised. */
if( i == 0 )
{
for( uxPriority = ( UBaseType_t ) 0U; uxPriority < ( UBaseType_t ) configMAX_PRIORITIES; uxPriority++ )
{
vListInitialise_Expect( &pxReadyTasksLists[ uxPriority ] );
}
vListInitialise_Expect( &xDelayedTaskList1 );
vListInitialise_Expect( &xDelayedTaskList2 );
vListInitialise_Expect( &xPendingReadyList );
vListInitialise_Expect( &xTasksWaitingTermination );
vListInitialise_Expect( &xSuspendedTaskList );
}
listINSERT_END_ExpectAnyArgs(); listINSERT_END_ExpectAnyArgs();
portSetupTCB_CB_ExpectAnyArgs(); portSetupTCB_CB_ExpectAnyArgs();
vFakePortGetCoreID_ExpectAndReturn( 0 );
vFakePortExitCriticalSection_Expect(); vFakePortExitCriticalSection_Expect();
} }
@ -1190,6 +1213,7 @@ void test_coverage_prvCreateIdleTasks_name_too_long( void )
pcIdleTaskName = "IDLE long name"; pcIdleTaskName = "IDLE long name";
uxCurrentNumberOfTasks = 2; uxCurrentNumberOfTasks = 2;
xSchedulerRunning = pdFALSE;
for( i = 0; i < configNUMBER_OF_CORES; i++ ) for( i = 0; i < configNUMBER_OF_CORES; i++ )
{ {
@ -1203,10 +1227,10 @@ void test_coverage_prvCreateIdleTasks_name_too_long( void )
vListInitialiseItem_ExpectAnyArgs(); vListInitialiseItem_ExpectAnyArgs();
listSET_LIST_ITEM_VALUE_ExpectAnyArgs(); listSET_LIST_ITEM_VALUE_ExpectAnyArgs();
pxPortInitialiseStack_ExpectAnyArgsAndReturn( NULL ); pxPortInitialiseStack_ExpectAnyArgsAndReturn( NULL );
vFakePortEnterCriticalSection_Expect(); vFakePortEnterCriticalSection_Expect();
listINSERT_END_ExpectAnyArgs(); listINSERT_END_ExpectAnyArgs();
portSetupTCB_CB_ExpectAnyArgs(); portSetupTCB_CB_ExpectAnyArgs();
vFakePortGetCoreID_ExpectAndReturn( 0 );
vFakePortExitCriticalSection_Expect(); vFakePortExitCriticalSection_Expect();
} }

Loading…
Cancel
Save