From 17cba40e832b991a6f956939c5ea28d3e04f678f Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Wed, 26 Jul 2023 16:26:44 +0200 Subject: [PATCH] test: extend VMH testing with an allocation Add calls to vmh_alloc() and vmh_free() for testing. Signed-off-by: Guennadi Liakhovetski --- zephyr/test/vmh.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/zephyr/test/vmh.c b/zephyr/test/vmh.c index 0ed36c4d8691..005498db0721 100644 --- a/zephyr/test/vmh.c +++ b/zephyr/test/vmh.c @@ -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); }