blob: afd3652626db0a8cbbe700e908c6cc36469686da [file] [log] [blame]
Gabor Tothf4692ed2024-12-03 09:32:55 +01001/*
2 * Copyright (c) 2024, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef MOCK_LIBC_H
9#define MOCK_LIBC_H
10
11#include "../include/malloc.h"
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17/*
18 * libc is used everywhere in the sources so it useful to enable mocking
19 * only for the realted testcases to avoid the necessity of filling the
20 * tests with a huge amount of expect calls.
21 */
22void mock_libc_enable(void);
23void mock_libc_disable(void);
24
25void expect_malloc(void *result);
26void* MOCK_MALLOC(size_t size);
27
28void expect_calloc(void *result);
29void* MOCK_CALLOC(size_t nmemb, size_t size);
30
31#ifdef __cplusplus
32}
33#endif
34
35#endif /* MOCK_LIBC_H */