]> begriffs open source - cmsis-driver-validation/blob - Include/DV_Typedefs.h
Updated WiFi test example for STMicroelectonics B-L475E-IOT01A1 board (added test...
[cmsis-driver-validation] / Include / DV_Typedefs.h
1 /*-----------------------------------------------------------------------------
2  *      Name:         DV_Typedefs.h 
3  *      Purpose:      Test framework filetypes and structures header
4  *----------------------------------------------------------------------------
5  *      Copyright(c) KEIL - An ARM Company
6  *----------------------------------------------------------------------------*/
7
8 #ifndef __CMSIS_DV_TYPEDEFS_H__
9 #define __CMSIS_DV_TYPEDEFS_H__
10
11 #include <stdint.h>
12 #include <stdarg.h>
13 #include <string.h>
14 #include <stdio.h>
15
16 typedef unsigned int    BOOL;
17
18 #ifndef __TRUE
19  #define __TRUE         1
20 #endif
21 #ifndef __FALSE
22  #define __FALSE        0
23 #endif
24
25 #ifndef ENABLED
26  #define ENABLED        1
27 #endif
28 #ifndef DISABLED
29  #define DISABLED       0
30 #endif
31
32 #ifndef NULL
33  #ifdef __cplusplus              // EC++
34   #define NULL          0
35  #else
36   #define NULL          ((void *) 0)
37  #endif
38 #endif
39
40 #define ARRAY_SIZE(arr) (sizeof(arr)/sizeof((arr)[0]))
41
42 /* Test macros */
43 #define TEST_FAIL()                             TEST_FAIL_MESSAGE("[FAILED]")
44 #define TEST_FAIL_MESSAGE(message)              __set_result (__FILE__, __LINE__, message, FAILED)
45 #define TEST_PASS()                             TEST_PASS_MESSAGE(NULL)
46 #define TEST_PASS_MESSAGE(message)              __set_result (__FILE__, __LINE__, message, PASSED)
47
48 #define TEST_ASSERT(condition)                  TEST_ASSERT_MESSAGE(condition,"[FAILED]")
49 #define TEST_ASSERT_MESSAGE(condition,message)  if (condition) { __set_result (__FILE__, __LINE__, NULL, PASSED); } else __set_result (__FILE__, __LINE__, message, FAILED)
50
51 #define TEST_MESSAGE(message)                   __set_message(__FILE__, __LINE__, message)
52
53 #endif /* __CMSIS_DV_TYPEDEFS_H__ */