1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

12 Commits

Author SHA1 Message Date
Marian Buschsieweke
a6ceeec29f
tests/malloc: fix counting bug
There is a corner cases in which the counting of allocated memory
previously was wrong: When the allocation of the chunk succeeded but the
allocation of the next struct  node fails. This was relatively unlikely
to happen, as the chunk size was much bigger than the memory required by
the struct node. But it happens on the ESP32 boards resulting in failing
nightlies. This fixes the issue.
2021-12-03 10:09:46 +01:00
Erik Ekman
c0004920ec tests/malloc: Fix cppcheck error
tests/malloc/main.c:123: error (preprocessorErrorDirective): Bad suppression attribute '(should'.
You can write comments in the comment after a ; or //. Valid suppression attributes; symbolName=sym
2021-11-25 11:13:30 +01:00
Marian Buschsieweke
8c31227060
tests/malloc: test for correct calloc() behavior 2021-05-10 18:04:53 +02:00
Francisco Molina
2d690ee05a
tests/malloc: refactor test
Matching on every free leads to flimsy test results where all memory
is freed but one line fails to be matched by pexpect, instead, match
the final count.
2021-05-03 17:17:49 +02:00
Benjamin Valentin
ebdcacc1a8 tests/malloc: fail if allocation count does not match
If we can't allocate the same amount of buffers in the second run,
fail the test. This indicates that not all buffers have been properly
freed.
2020-11-19 21:59:14 +01:00
da898e649c tests/malloc: reduce chunk size to 128b
Otherwise, the test fails on z1 (with no allocations).
2020-07-23 12:50:32 +02:00
561daaab81
tests/malloc: reduce defaut chunk size
This allows to automatically run the test on very constrained platforms such as arduino-uno (2KB RAM)
2019-11-26 15:21:47 +01:00
254f6ff9f9
tests/malloc: cleanup in test application
The idea is not fill the memory on the computer running a native instance and to be able to test on hardware. The test application is reworked similarly as the memarray test application. Macro are now overridable and printed at the beginnined of the test: this allows easier automatic testing
2019-11-20 06:44:30 +01:00
Benjamin Valentin
769fe44f6d tests/malloc: cleanup
- make local functions / variables static
- adhere to the 80 column limit
- don't increment total if head could not be allocated
- allow to overwrite CHUNK_SIZE
2019-09-13 00:35:47 +02:00
Gunar Schorcht
136849661a tests/malloc: fix of dereferencing a NULL pointer
If the memory is exhausted during the allocation of the new `head` structure, subsequent accesses to `head` will result in dereferencing of a NULL pointer.
2019-03-23 14:01:28 +01:00
Joakim Gebart
7b0ade0b75 tests/malloc: Replace tabs by spaces 2015-05-19 12:26:34 +02:00
Benjamin Valentin
39d73d753c resurrect malloc test 2014-11-05 12:11:24 +01:00