* support/regression/fwk/include/testfwk.h: added defines for xdata, idata for pic16
[fw/sdcc] / support / regression / fwk / include / testfwk.h
1 #ifndef __TESTFWK_H
2 #define __TESTFWK_H   1
3
4 extern int __numTests;
5
6 void __fail(const char *szMsg, const char *szCond, const char *szFile, int line);
7 void __printf(const char *szFormat, ...);
8
9 #define ASSERT(_a)  (__numTests++, (_a) ? (void)0 : __fail("Assertion failed", #_a, __FILE__, __LINE__))
10 #define LOG(_a)     __printf _a
11 #define FAIL()      FAILM("Failure")
12 #define FAILM(_a)   __fail(_a, #_a, __FILE__, __LINE__)
13
14 typedef void (*TESTFUNP)(void);
15
16 // Provided by the suite
17 TESTFUNP *suite(void);
18
19 const char *getSuiteName(void);
20
21 #define NULL  0
22
23 #define UNUSED(_a)  if (_a) { }
24
25 #if defined(PORT_HOST) || defined(SDCC_z80) || defined(SDCC_gbz80)
26 # define idata
27 # define pdata
28 # define xdata
29 # define code
30 #endif
31
32 #if defined(SDCC_hc08)
33 # define idata data
34 # define pdata data
35 #endif
36
37 #if defined(SDCC_pic16)
38 # define idata data
39 # define xdata data
40 #endif
41
42 #endif