Skip to content

Commit

Permalink
test: extend VMH testing with an allocation
Browse files Browse the repository at this point in the history
Add calls to vmh_alloc() and vmh_free() for testing.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
  • Loading branch information
lyakh committed Jul 27, 2023
1 parent e1b09a4 commit 17cba40
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion zephyr/test/vmh.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,21 @@

static int vmh_test(void)
{
struct virtual_memory_heap *h = vmh_init_heap(NULL, MEM_REG_ATTR_CORE_HEAP, 0, false);
struct vmh_heap *h = vmh_init_heap(NULL, MEM_REG_ATTR_CORE_HEAP, 0, false);

if (!h)
return -EINVAL;

char *buf = vmh_alloc(h, 1616);

if (!buf)
return -ENOMEM;

buf[0] = 0;
buf[1615] = 15;

vmh_free(h, buf);

return vmh_free_heap(h);
}

Expand Down

0 comments on commit 17cba40

Please sign in to comment.