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 "mocks/util.h"
10 #include "mocks/util_expects.h"
11
expect_single_call_u8_to_dec(uint8_t value)12 void expect_single_call_u8_to_dec(uint8_t value)
13 {
14 const char *func_name = "u8_to_dec";
15
16 zassert_equal(u8_to_dec_fake.call_count, 1, "'%s()' was called more than once",
17 func_name);
18
19 zassert_not_null(u8_to_dec_fake.arg0_val, "'%s()' was called with incorrect '%s' value",
20 func_name, "buf");
21 zassert_true(u8_to_dec_fake.arg1_val != 0, "'%s()' was called with incorrect '%s' value",
22 func_name, "buflen");
23 zassert_equal(u8_to_dec_fake.arg2_val, value, "'%s()' was called with incorrect '%s' value",
24 func_name, "value");
25 }
26
expect_not_called_u8_to_dec(void)27 void expect_not_called_u8_to_dec(void)
28 {
29 const char *func_name = "u8_to_dec";
30
31 zassert_equal(u8_to_dec_fake.call_count, 0, "'%s()' was called unexpectedly",
32 func_name);
33 }
34