TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
its_tests_common.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef __ITS_TESTS_COMMON_H__
9 #define __ITS_TESTS_COMMON_H__
10 
11 #include "test_framework_helpers.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 /* Test UIDs */
18 #define WRITE_ONCE_UID 1U /* Cannot be modified or deleted once created */
19 #define TEST_UID_1 2U
20 #define TEST_UID_2 3U
21 #define TEST_UID_3 4U
22 
23 /* Invalid values */
24 #define INVALID_UID 0U
25 #define INVALID_DATA_LEN UINT32_MAX
26 #define INVALID_OFFSET UINT32_MAX
27 #define INVALID_FLAG (1U << 31)
28 
29 /* Write once data */
30 #define WRITE_ONCE_DATA "THE_FIVE_BOXING_WIZARDS_JUMP_QUICKLY"
31 #define WRITE_ONCE_DATA_SIZE (sizeof(WRITE_ONCE_DATA) - 1)
32 #define WRITE_ONCE_READ_DATA "############################################"
33 #define WRITE_ONCE_RESULT_DATA ("####" WRITE_ONCE_DATA "####")
34 
35 #define WRITE_DATA "THEQUICKBROWNFOXJUMPSOVERALAZYDOG"
36 #define WRITE_DATA_SIZE (sizeof(WRITE_DATA) - 1)
37 #define READ_DATA "_________________________________________"
38 #define RESULT_DATA ("____" WRITE_DATA "____")
39 #define OFFSET_READ_DATA "HEQUICKBROWNFOXJUMPSOVERALAZYDOG"
40 #define OFFSET_RESULT_DATA ("____" OFFSET_READ_DATA "_____")
41 
54 #define BUFFER_SIZE 24
55 #define PADDING_SIZE 8
56 #define HALF_PADDING_SIZE 4
57 #define BUFFER_PLUS_PADDING_SIZE (BUFFER_SIZE + PADDING_SIZE)
58 #define BUFFER_PLUS_HALF_PADDING_SIZE (BUFFER_SIZE + HALF_PADDING_SIZE)
59 
67 void tfm_its_test_common_001(struct test_result_t *ret);
68 
77 void tfm_its_test_common_002(struct test_result_t *ret);
78 
90 void tfm_its_test_common_003(struct test_result_t *ret);
91 
98 void tfm_its_test_common_004(struct test_result_t *ret);
99 
107 void tfm_its_test_common_005(struct test_result_t *ret);
108 
116 void tfm_its_test_common_006(struct test_result_t *ret);
117 
125 void tfm_its_test_common_007(struct test_result_t *ret);
126 
135 void tfm_its_test_common_008(struct test_result_t *ret);
136 
148 void tfm_its_test_common_009(struct test_result_t *ret);
149 
156 void tfm_its_test_common_010(struct test_result_t *ret);
157 
164 void tfm_its_test_common_011(struct test_result_t *ret);
165 
173 void tfm_its_test_common_012(struct test_result_t *ret);
174 
181 void tfm_its_test_common_013(struct test_result_t *ret);
182 
189 void tfm_its_test_common_014(struct test_result_t *ret);
190 
197 void tfm_its_test_common_015(struct test_result_t *ret);
198 
208 void tfm_its_test_common_016(struct test_result_t *ret);
209 
215 void tfm_its_test_common_017(struct test_result_t *ret);
216 
222 void tfm_its_test_common_018(struct test_result_t *ret);
223 
231 void tfm_its_test_common_019(struct test_result_t *ret);
232 
233 #ifdef __cplusplus
234 }
235 #endif
236 
237 #endif /* __ITS_TESTS_COMMON_H__ */
void tfm_its_test_common_006(struct test_result_t *ret)
Tests get function with:
void tfm_its_test_common_004(struct test_result_t *ret)
Tests set function with:
void tfm_its_test_common_015(struct test_result_t *ret)
Tests remove function with:
void tfm_its_test_common_019(struct test_result_t *ret)
Tests set, get_info, get and remove function with:
void tfm_its_test_common_013(struct test_result_t *ret)
Tests remove function with:
void tfm_its_test_common_001(struct test_result_t *ret)
Tests set function with:
void tfm_its_test_common_003(struct test_result_t *ret)
Tests set function with:
void tfm_its_test_common_010(struct test_result_t *ret)
Tests get info function with:
void tfm_its_test_common_018(struct test_result_t *ret)
Tests multiple sets to the same UID.
void tfm_its_test_common_017(struct test_result_t *ret)
Tests set and multiple partial gets.
void tfm_its_test_common_002(struct test_result_t *ret)
Tests set function with:
void tfm_its_test_common_008(struct test_result_t *ret)
Tests get function with:
void tfm_its_test_common_007(struct test_result_t *ret)
Tests get function with:
void tfm_its_test_common_012(struct test_result_t *ret)
Tests get info function with:
void tfm_its_test_common_014(struct test_result_t *ret)
Tests remove function with:
void tfm_its_test_common_009(struct test_result_t *ret)
Tests get function with:
void tfm_its_test_common_011(struct test_result_t *ret)
Tests get info function with:
void tfm_its_test_common_005(struct test_result_t *ret)
Tests get function with:
void tfm_its_test_common_016(struct test_result_t *ret)
Tests data block compact feature. Set UID 1 to locate it at the beginning of the block. Then set UID 2 to be located after UID 1 and remove UID 1. UID 2 will be compacted to the beginning of the block. This test verifies that the compaction works correctly by reading back UID 2.