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 <zephyr/bluetooth/buf.h>
9 #include <host/keys.h>
10 #include "mocks/settings_store.h"
11 #include "mocks/settings_store_expects.h"
12 
expect_single_call_bt_settings_delete_keys(void)13 void expect_single_call_bt_settings_delete_keys(void)
14 {
15 	const char *func_name = "bt_settings_delete_keys";
16 
17 	zassert_equal(bt_settings_delete_keys_fake.call_count, 1,
18 		      "'%s()' was called more than once", func_name);
19 }
20 
expect_single_call_bt_settings_store_keys(const void * value)21 void expect_single_call_bt_settings_store_keys(const void *value)
22 {
23 	const char *func_name = "bt_settings_store_keys";
24 
25 	zassert_equal(bt_settings_store_keys_fake.call_count, 1, "'%s()' was called more than once",
26 		      func_name);
27 
28 	zassert_equal(bt_settings_store_keys_fake.arg2_val, value,
29 		      "'%s()' was called with incorrect '%s' value", func_name, "value");
30 	zassert_equal(bt_settings_store_keys_fake.arg3_val, BT_KEYS_STORAGE_LEN,
31 		      "'%s()' was called with incorrect '%s' value", func_name, "val_len");
32 }
33 
expect_not_called_bt_settings_store_keys(void)34 void expect_not_called_bt_settings_store_keys(void)
35 {
36 	const char *func_name = "bt_settings_store_keys";
37 
38 	zassert_equal(bt_settings_store_keys_fake.call_count, 0, "'%s()' was called unexpectedly",
39 		      func_name);
40 }
41