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));
60 void __printf(const char *szFormat, ...) REENTRANT
63 va_start(ap, szFormat);
66 if (*szFormat == '%') {
67 switch (*++szFormat) {
69 char GENERIC *sz = va_arg(ap, char GENERIC *);
76 int i = va_arg(ap, int);
99 __fail(const char *szMsg, const char *szCond, const char *szFile, int line)
101 __printf("--- FAIL: \"%s\" on %s at %s:%u\n", szMsg, szCond, szFile, line);
111 __printf("--- Running: %s\n", getSuiteName());
113 cases = (TESTFUN **)suite();
116 __printf("Running %u\n", numCases);
122 __printf("--- Summary: %u/%u/%u: %u failed of %u tests in %u cases.\n",
123 __numFailures, __numTests, numCases,
124 __numFailures, __numTests, numCases