Gabor Toth | f4692ed | 2024-12-03 09:32:55 +0100 | [diff] [blame^] | 1 | /* |
| 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 |
| 14 | extern "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 | */ |
| 22 | void mock_libc_enable(void); |
| 23 | void mock_libc_disable(void); |
| 24 | |
| 25 | void expect_malloc(void *result); |
| 26 | void* MOCK_MALLOC(size_t size); |
| 27 | |
| 28 | void expect_calloc(void *result); |
| 29 | void* MOCK_CALLOC(size_t nmemb, size_t size); |
| 30 | |
| 31 | #ifdef __cplusplus |
| 32 | } |
| 33 | #endif |
| 34 | |
| 35 | #endif /* MOCK_LIBC_H */ |