| 68 | *-----------------------------------------------*/ |
| 69 | |
| 70 | void UnityPrint(const char* string) |
| 71 | { |
| 72 | const char* pch = string; |
| 73 | |
| 74 | if (pch != NULL) |
| 75 | { |
| 76 | while (*pch) |
| 77 | { |
| 78 | /* printable characters plus CR & LF are printed */ |
| 79 | if ((*pch <= 126) && (*pch >= 32)) |
| 80 | { |
| 81 | UNITY_OUTPUT_CHAR(*pch); |
| 82 | } |
| 83 | /* write escaped carriage returns */ |
| 84 | else if (*pch == 13) |
| 85 | { |
| 86 | UNITY_OUTPUT_CHAR('\\'); |
| 87 | UNITY_OUTPUT_CHAR('r'); |
| 88 | } |
| 89 | /* write escaped line feeds */ |
| 90 | else if (*pch == 10) |
| 91 | { |
| 92 | UNITY_OUTPUT_CHAR('\\'); |
| 93 | UNITY_OUTPUT_CHAR('n'); |
| 94 | } |
| 95 | #ifdef UNITY_OUTPUT_COLOR |
| 96 | /* print ANSI escape code */ |
| 97 | else if (*pch == 27 && *(pch + 1) == '[') |
| 98 | { |
| 99 | while (*pch && *pch != 'm') |
| 100 | { |
| 101 | UNITY_OUTPUT_CHAR(*pch); |
| 102 | pch++; |
| 103 | } |
| 104 | UNITY_OUTPUT_CHAR('m'); |
| 105 | } |
| 106 | #endif |
| 107 | /* unprintable characters are shown as codes */ |
| 108 | else |
| 109 | { |
| 110 | UNITY_OUTPUT_CHAR('\\'); |
| 111 | UNITY_OUTPUT_CHAR('x'); |
| 112 | UnityPrintNumberHex((UNITY_UINT)*pch, 2); |
| 113 | } |
| 114 | pch++; |
| 115 | } |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | void UnityPrintLen(const char* string, const UNITY_UINT32 length) |
| 120 | { |
searching dependent graphs…