acassis opened a new pull request, #4064:
URL: https://github.com/apache/nuttx-apps/pull/4064
## Summary
Test gran_reserve() and gran_alloc_align() on a heap of 16 granules of 16
bytes:
* A reservation uses only the granules that hold the range, also in the last
granule of the heap, and gran_free() releases all of them.
* An alignment of zero means no alignment, and does not return memory that
is in use.
* An alignment that is not a power of two returns NULL. An alignment that
is a power of two is kept.
On nuttx master, the reservation cases fail without "mm/mm_gran: Reserve
only the granules that hold the range." and the alignment cases fail without
"mm/mm_gran: Check the alignment given to gran_alloc_align()."
The test needs CONFIG_GRAN and the flat build, in which applications can
call the granule allocator.
## Impact
Improvement
## Testing
```
grantest: reserve one granule: FAIL (expected 1, got 2)
grantest: reserve the last granule: FAIL (expected 15, got -1)
grantest: reserve, free, allocate the heap: FAIL (expected 0, got -1)
grantest: align 0, two granules: FAIL (expected 2, got 0)
grantest: align 0, one granule: FAIL (expected 0, got -1)
grantest: align 3 granules: FAIL (expected -1, got 1)
grantest: align 4 granules: PASS (expected 4, got 4)
grantest: 6 failed
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]