Opened on 03/08/15 at 21:36:04
Last modified on 01/25/17 at 13:05:19
#2288 assigned defect
Use of assert()
Reported by: | Joel Sherrill | Owned by: | Needs Funding |
---|---|---|---|
Priority: | normal | Milestone: | Indefinite |
Component: | unspecified | Version: | 4.11 |
Severity: | normal | Keywords: | |
Cc: | Blocked By: | ||
Blocking: |
Description
While reviewing test results, I noticed a few uses of regular assert().
There are 92 in cpukit/.
There are 70 in testsuites/
There are 371 in c/
Should at least the ones in cpukit/ be changed to RTEMS asserts before we branch?
Attachments (1)
Change History (4)
comment:1 Changed on 03/09/15 at 18:32:13 by Joel Sherrill
comment:2 Changed on 05/16/15 at 09:42:56 by Sebastian Huber
The problem with rtems_test_assert() is that it ends up in exit() which is not a good idea in certain tests.
The assert() in c/ should get converted to bsp_fatal(). In cpukit to _Assert() or a fatal error with a unique (source, code). Maybe we should add a rtems_assert() (like assert() but controlled via RTEMS_DEBUG).
Changed on 12/25/15 at 22:01:52 by jfjhh
Attachment: | SQUASHED-Fix-Use-of-assert-ticket-2288.patch added |
---|
Fixes usage of assert(). Adds a new bsp_error_code block.
comment:3 Changed on 01/25/17 at 13:05:19 by Sebastian Huber
Milestone: | 4.11 → Indefinite |
---|---|
Owner: | set to Needs Funding |
Status: | new → assigned |
Note: See
TracTickets for help on using
tickets.
FWIW this looks like the set of tests using assert().
./fstests/fstime/test.c
./libtests/block09/init.c
./libtests/block10/init.c
./libtests/capture01/init.c
./libtests/exit01/init.c
./libtests/exit02/init.c
./libtests/flashdisk01/test-file-system.c
./smptests/smpfatal01/init.c
./smptests/smpfatal02/init.c
./smptests/smpfatal03/init.c
./smptests/smpfatal04/init.c
./smptests/smpfatal05/init.c
./smptests/smpfatal08/init.c
./sptests/spheapprot/init.c
So that shouldn't be too bad to correct if all can be safely changed to rtems_test_assert().
I am also not sure what rb_heap_assert() maps down to.