1 /** Test framework support functions.
6 /** Define this if the port's div or mod functions are broken.
7 A slow loop based method will be substituded.
9 #define BROKEN_DIV_MOD 1
11 void _putchar(char c);
15 int __div(int num, int denom)
18 while (num >= denom) {
25 int __mod(int num, int denom)
27 while (num >= denom) {
33 int __div(int num, int denom)
38 int __mod(int num, int denom)
44 static void _printn(int n)
55 _printn(__div(n, 10));
72 void __printf(const char *szFormat, ...) REENTRANT
75 va_start(ap, szFormat);
78 if (*szFormat == '%') {
79 switch (*++szFormat) {
82 #warning Workaround bug #436344
85 generic_p_u.part.data_space = va_arg (ap, char);
86 generic_p_u.part.offset = va_arg (ap, int);
89 char GENERIC *sz = va_arg(ap, char GENERIC *);
97 int i = va_arg(ap, int);
120 __fail(const char *szMsg, const char *szCond, const char *szFile, int line)
122 __printf("--- FAIL: \"%s\" on %s at %s:%u\n", szMsg, szCond, szFile, line);
132 __printf("--- Running: %s\n", getSuiteName());
134 cases = (TESTFUN **)suite();
137 __printf("Running %u\n", numCases);
143 __printf("--- Summary: %u/%u/%u: %u failed of %u tests in %u cases.\n",
144 __numFailures, __numTests, numCases,
145 __numFailures, __numTests, numCases