1 /*
2  * Copyright (c) 2022 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/kernel.h>
8 #include "mocks/hci_core.h"
9 #include "mocks/hci_core_expects.h"
10 
expect_call_count_bt_hci_le_rand(int call_count,uint8_t args_history[])11 void expect_call_count_bt_hci_le_rand(int call_count, uint8_t args_history[])
12 {
13 	const char *func_name = "bt_hci_le_rand";
14 
15 	zassert_equal(bt_hci_le_rand_fake.call_count, call_count,
16 		      "'%s()' was called more than once", func_name);
17 
18 	for (size_t i = 0; i < call_count; i++) {
19 		zassert_not_null(bt_hci_le_rand_fake.arg0_history[i],
20 				 "'%s()' was called with incorrect '%s' value", func_name,
21 				 "buffer");
22 		zassert_equal(bt_hci_le_rand_fake.arg1_history[i], args_history[i],
23 			      "'%s()' was called with incorrect '%s' value", func_name, "len");
24 	}
25 }
26 
expect_not_called_bt_hci_le_rand(void)27 void expect_not_called_bt_hci_le_rand(void)
28 {
29 	const char *func_name = "bt_hci_le_rand";
30 
31 	zassert_equal(bt_hci_le_rand_fake.call_count, 0, "'%s()' was called unexpectedly",
32 		      func_name);
33 }
34