RTEMS | testsuites/sptests: Add spcan02 POSIX functional test for virtual CAN bus (!1113)

Gedare Bloom (@gedare) gitlab at rtems.org
Thu Mar 12 00:27:51 UTC 2026




Gedare Bloom started a new discussion on testsuites/sptests/spcan02/init.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1113#note_145082

 > +  int         received;
 > +  int         send_interval;
 > +  int         burst;
 > +  atomic_uint active_tasks;
 > +};
 > +
 > +static rtems_task can_receiver( rtems_task_argument arg )
 > +{
 > +  struct can_frame          frame;
 > +  struct can_test_instance *priv;
 > +  int                       ret;
 > +
 > +  priv = (struct can_test_instance *) arg;
 > +
 > +  while (
 > +    priv->frames_to_receive > 0 && priv->received < priv->frames_to_receive

`priv->frames_to_receive` is a loop invariant, you should check this outside of the loop, or even use `assert( priv->frames_to_receive > 0 );`

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1113#note_145082
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260312/6811af6a/attachment-0001.htm>


More information about the bugs mailing list