1 /*
2 * Copyright (c) 2022 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #include "mocks/crypto.h"
8 #include "mocks/crypto_expects.h"
9
10 #include <zephyr/kernel.h>
11
expect_single_call_bt_rand(void * buf,size_t len)12 void expect_single_call_bt_rand(void *buf, size_t len)
13 {
14 const char *func_name = "bt_rand";
15
16 zassert_equal(bt_rand_fake.call_count, 1, "'%s()' was called more than once", func_name);
17
18 zassert_equal(bt_rand_fake.arg0_val, buf, "'%s()' was called with incorrect '%s' value",
19 func_name, "buf");
20 zassert_equal(bt_rand_fake.arg1_val, len, "'%s()' was called with incorrect '%s' value",
21 func_name, "len");
22 }
23
expect_not_called_bt_rand(void)24 void expect_not_called_bt_rand(void)
25 {
26 const char *func_name = "bt_rand";
27
28 zassert_equal(bt_rand_fake.call_count, 0, "'%s()' was called unexpectedly", func_name);
29 }
30