2 * Copyright (c) 2015-2020 Arm Limited. All rights reserved.
4 * SPDX-License-Identifier: Apache-2.0
6 * Licensed under the Apache License, Version 2.0 (the License); you may
7 * not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 * -----------------------------------------------------------------------------
20 * Project: CMSIS-Driver Validation
21 * Title: Test framework type definitions and test macros header file
23 * -----------------------------------------------------------------------------
27 #ifndef __CMSIS_DV_TYPEDEFS_H__
28 #define __CMSIS_DV_TYPEDEFS_H__
35 typedef unsigned int BOOL;
52 #ifdef __cplusplus // EC++
55 #define NULL ((void *) 0)
59 #define ARRAY_SIZE(arr) (sizeof(arr)/sizeof((arr)[0]))
61 /* Test group info macro */
62 #define TEST_GROUP_INFO(info) __tg_info (info)
65 #define TEST_FAIL() TEST_FAIL_MESSAGE(NULL)
66 #define TEST_FAIL_MESSAGE(message) __set_result (__FILE__, __LINE__, message, FAILED)
67 #define TEST_PASS() TEST_PASS_MESSAGE(NULL)
68 #define TEST_PASS_MESSAGE(message) __set_result (__FILE__, __LINE__, message, PASSED)
70 #define TEST_ASSERT(condition) TEST_ASSERT_MESSAGE(condition,"[FAILED]")
71 #define TEST_ASSERT_MESSAGE(condition,message) if (condition) { __set_result (__FILE__, __LINE__, NULL, PASSED); } else { __set_result (__FILE__, __LINE__, message, FAILED); }
73 #define TEST_MESSAGE(message) __set_message(__FILE__, __LINE__, message)
75 #endif /* __CMSIS_DV_TYPEDEFS_H__ */