#include <zephyr/ztest.h>
#include <zephyr/kernel.h>
#include <zpp/mem_slab.hpp>
Go to the source code of this file.
|
| ZTEST_SUITE (zpp_mem_slab_tests, NULL, NULL, NULL, NULL, NULL) |
|
| ZTEST (zpp_mem_slab_tests, test_mem_slab) |
|
◆ ZTEST()
ZTEST |
( |
zpp_mem_slab_tests |
, |
|
|
test_mem_slab |
|
|
) |
| |
Definition at line 22 of file main.cpp.
24 const auto total = g_mem_slab.total_block_count();
26 zassert_equal(g_mem_slab.free_block_count(), total,
"");
27 zassert_equal(g_mem_slab.used_block_count(), 0,
"");
29 auto p = g_mem_slab.allocate();
31 zassert_not_null(p,
"");
33 zassert_equal(g_mem_slab.free_block_count(), total - 1,
"");
34 zassert_equal(g_mem_slab.used_block_count(), 1,
"");
36 g_mem_slab.deallocate(p);
38 zassert_equal(g_mem_slab.free_block_count(), total,
"");
39 zassert_equal(g_mem_slab.used_block_count(), 0,
"");
◆ ZTEST_SUITE()
ZTEST_SUITE |
( |
zpp_mem_slab_tests |
, |
|
|
NULL |
, |
|
|
NULL |
, |
|
|
NULL |
, |
|
|
NULL |
, |
|
|
NULL |
|
|
) |
| |