zephyr/tests/bluetooth/host/keys/mocks/id_expects.c
Ahmed Moheb eceb8341e0 tests: bluetooth: host: Add UT for bt_keys_clear()
Unit test project for bt_keys_clear().
This part of subsys/bluetooth/host/buf.c unit testing

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-12-27 15:33:40 +01:00

30 lines
712 B
C

/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/kernel.h>
#include <zephyr/bluetooth/buf.h>
#include "mocks/id.h"
#include "mocks/id_expects.h"
void expect_single_call_bt_id_del(struct bt_keys *keys)
{
const char *func_name = "bt_id_del";
zassert_equal(bt_id_del_fake.call_count, 1, "'%s()' was called more than once",
func_name);
zassert_equal(bt_id_del_fake.arg0_val, keys,
"'%s()' was called with incorrect '%s' value", func_name, "keys");
}
void expect_not_called_bt_id_del(void)
{
const char *func_name = "bt_id_del";
zassert_equal(bt_id_del_fake.call_count, 0, "'%s()' was called unexpectedly",
func_name);
}