Skip to content

Commit 87917a1

Browse files
committed
tests: bt: host: mock k_heap_aligned_alloc
unit tests needs mocking for k_heap_aligned_alloc. Signed-off-by: Anas Nashif <[email protected]>
1 parent ef41627 commit 87917a1

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

tests/bluetooth/host/conn/mocks/kernel.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,7 @@ DEFINE_FAKE_VALUE_FUNC(void *, k_heap_alloc, struct k_heap *, size_t, k_timeout_
3131
DEFINE_FAKE_VOID_FUNC(k_heap_free, struct k_heap *, void *);
3232
DEFINE_FAKE_VOID_FUNC(k_sched_lock);
3333
DEFINE_FAKE_VOID_FUNC(k_sched_unlock);
34+
DEFINE_FAKE_VALUE_FUNC(void *, k_heap_aligned_alloc, struct k_heap *,
35+
size_t, size_t, k_timeout_t);
3436

3537
struct k_work_q k_sys_work_q;

tests/bluetooth/host/conn/mocks/kernel.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
FAKE(k_queue_get) \
3030
FAKE(k_queue_prepend) \
3131
FAKE(k_heap_alloc) \
32+
FAKE(k_heap_aligned_alloc) \
3233
FAKE(k_heap_free) \
3334
FAKE(k_sched_lock) \
3435
FAKE(k_sched_unlock) \
@@ -56,3 +57,5 @@ DECLARE_FAKE_VALUE_FUNC(void *, k_heap_alloc, struct k_heap *, size_t, k_timeout
5657
DECLARE_FAKE_VOID_FUNC(k_heap_free, struct k_heap *, void *);
5758
DECLARE_FAKE_VOID_FUNC(k_sched_lock);
5859
DECLARE_FAKE_VOID_FUNC(k_sched_unlock);
60+
DECLARE_FAKE_VALUE_FUNC(void *, k_heap_aligned_alloc, struct k_heap *,
61+
size_t, size_t, k_timeout_t);

0 commit comments

Comments
 (0)