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

@ -113,6 +113,10 @@ extern volatile UBaseType_t uxCurrentNumberOfTasks;
extern volatile UBaseType_t uxSchedulerSuspended;
extern volatile UBaseType_t uxTopReadyPriority;
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 volatile TickType_t xTickCount;
extern volatile TickType_t xNextTaskUnblockTime;
@ -1125,8 +1129,10 @@ void test_coverage_prvCreateIdleTasks_name_within_max_len( void )
TCB_t * xIdleTask;
TCB_t xTask = { 0 };
int i;
UBaseType_t uxPriority;
pcIdleTaskName = "IDLE longXX";
xSchedulerRunning = pdFALSE;
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();
pxPortInitialiseStack_ExpectAnyArgsAndReturn( NULL );
/* prvAddNewTaskToReadyList. */
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();
portSetupTCB_CB_ExpectAnyArgs();
vFakePortGetCoreID_ExpectAndReturn( 0 );
vFakePortExitCriticalSection_Expect();
}
@ -1190,6 +1213,7 @@ void test_coverage_prvCreateIdleTasks_name_too_long( void )
pcIdleTaskName = "IDLE long name";
uxCurrentNumberOfTasks = 2;
xSchedulerRunning = pdFALSE;
for( i = 0; i < configNUMBER_OF_CORES; i++ )
{
@ -1203,10 +1227,10 @@ void test_coverage_prvCreateIdleTasks_name_too_long( void )
vListInitialiseItem_ExpectAnyArgs();
listSET_LIST_ITEM_VALUE_ExpectAnyArgs();
pxPortInitialiseStack_ExpectAnyArgsAndReturn( NULL );
vFakePortEnterCriticalSection_Expect();
listINSERT_END_ExpectAnyArgs();
portSetupTCB_CB_ExpectAnyArgs();
vFakePortGetCoreID_ExpectAndReturn( 0 );
vFakePortExitCriticalSection_Expect();
}

Loading…
Cancel
Save