testing/sched: fix off-by-one sample count in timerjitter

cur_cnt++ in the loop condition increments even when the loop body
doesn't run, so avg is divided by one more sample than was collected.

Signed-off-by: liang.huang <liang.huang@houmo.ai>
This commit is contained in:
liang.huang 2026-07-11 12:06:14 +08:00 committed by Alan C. Assis
parent 1d15c81f69
commit 2bcc6b96ea

View file

@ -195,8 +195,10 @@ static FAR void *timerjitter(FAR void *arg)
param->max = 0;
param->min = (unsigned long)-1;
while (param->cur_cnt++ < param->max_cnt)
while (param->cur_cnt < param->max_cnt)
{
param->cur_cnt++;
/* Wait for SIGALRM */
if (sigwait(&sigset, &sigs) < 0)