diff options
Diffstat (limited to 'support/regression/fwk')
-rw-r--r-- | support/regression/fwk/lib/testfwk.c | 55 |
1 files changed, 8 insertions, 47 deletions
diff --git a/support/regression/fwk/lib/testfwk.c b/support/regression/fwk/lib/testfwk.c index 715724a75..f0cc58121 100644 --- a/support/regression/fwk/lib/testfwk.c +++ b/support/regression/fwk/lib/testfwk.c @@ -51,16 +51,11 @@ __printNibble (unsigned char c) _putchar(c); } void -__printd (int n) +__printu (unsigned int n) { unsigned char chr; #define SWAP_BYTE(x) ((x) >> 4 | (x) << 4) - if (0 > n) - { - n = -n; - _putchar('-'); - } _putchar('x'); // This seems to be the most efficient way to do it for PDK (both in RAM & ROM) @@ -78,40 +73,6 @@ __printd (int n) } #else void -__printd (int n) -{ - if (0 == n) - { - _putchar('0'); - } - else - { - static char MEMSPACE_BUF buf[6]; - char MEMSPACE_BUF *p = &buf[sizeof (buf) - 1]; - char neg = 0; - - buf[sizeof(buf) - 1] = '\0'; - - if (0 > n) - { - n = -n; - neg = 1; - } - - while (0 != n) - { - *--p = '0' + __mod (n, 10); - n = __div (n, 10); - } - - if (neg) - _putchar('-'); - - __prints(p); - } -} - -void __printu (unsigned int n) { if (0 == n) @@ -223,7 +184,7 @@ __fail (__code const char *szMsg, __code const char *szCond, __code const char * __prints(" at "); __prints(szFile); _putchar(':'); - __printd(line); + __printu(line); _putchar('\n'); __numFailures++; @@ -241,19 +202,19 @@ main (void) __runSuite(); __prints("--- Summary: "); - __printd(__numFailures); + __printu(__numFailures); _putchar('/'); - __printd(__numTests); + __printu(__numTests); _putchar('/'); - __printd(__numCases); + __printu(__numCases); #ifndef TARGET_VERY_LOW_MEMORY __prints(": "); - __printd(__numFailures); + __printu(__numFailures); __prints(" failed of "); - __printd(__numTests); + __printu(__numTests); __prints(" tests in "); - __printd(__numCases); + __printu(__numCases); __prints(" cases.\n"); #else _putchar('\n'); |