blob: 1da739066d5496b44e76f3693172f92c580b8a04 [file] [log] [blame]
Kevin Peng62a87112020-07-07 15:07:46 +08001/*
2 * Copyright (c) 2017-2020, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef __S_TEST_HELPERS_H__
9#define __S_TEST_HELPERS_H__
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15/**
16 * Several tests use a buffer to read back data from an asset. This buffer is
17 * larger than the size of the asset data by PADDING_SIZE bytes. This allows
18 * us to ensure that the only the expected data is read back and that it is read
19 * back correctly.
20 *
21 * For example if the buffer and asset are as follows:
22 * Buffer - "XXXXXXXXXXXX", Asset data - "AAAA"
23 *
24 * Then a correct and successful read would give this result: "XXXXAAAAXXXX"
25 * (Assuming a PADDING_SIZE of 8)
26 */
27#define BUFFER_SIZE 24
28#define PADDING_SIZE 8
29#define HALF_PADDING_SIZE 4
30
31#define BUFFER_PLUS_PADDING_SIZE (BUFFER_SIZE + PADDING_SIZE)
32#define BUFFER_PLUS_HALF_PADDING_SIZE (BUFFER_SIZE + HALF_PADDING_SIZE)
33
34#ifdef __cplusplus
35}
36#endif
37
38#endif /* __S_TEST_HELPERS_H__ */