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/prng.h"
9 #include "mocks/prng_expects.h"
10
expect_single_call_tc_psa_crypto_init(void)11 void expect_single_call_tc_psa_crypto_init(void)
12 {
13 const char *func_name = "psa_crypto_init";
14
15 zassert_equal(psa_crypto_init_fake.call_count, 1, "'%s()' was called more than once",
16 func_name);
17 }
18
expect_single_call_psa_generate_random(uint8_t * out,size_t outlen)19 void expect_single_call_psa_generate_random(uint8_t *out, size_t outlen)
20 {
21 const char *func_name = "psa_generate_random";
22
23 zassert_equal(psa_generate_random_fake.call_count, 1,
24 "'%s()' was called more than once", func_name);
25
26 zassert_equal_ptr(psa_generate_random_fake.arg0_val, out,
27 "'%s()' was called with incorrect '%s' value", func_name, "out");
28 zassert_equal(psa_generate_random_fake.arg1_val, outlen,
29 "'%s()' was called with incorrect '%s' value", func_name, "outlen");
30 }
31