MCPcopy Index your code
hub / github.com/DaveGamble/cJSON / UnityPrintLen

Function UnityPrintLen

tests/unity/src/unity.c:119–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void UnityPrintLen(const char* string, const UNITY_UINT32 length)
120{
121 const char* pch = string;
122
123 if (pch != NULL)
124 {
125 while (*pch && (UNITY_UINT32)(pch - string) < length)
126 {
127 /* printable characters plus CR & LF are printed */
128 if ((*pch <= 126) && (*pch >= 32))
129 {
130 UNITY_OUTPUT_CHAR(*pch);
131 }
132 /* write escaped carriage returns */
133 else if (*pch == 13)
134 {
135 UNITY_OUTPUT_CHAR('\\');
136 UNITY_OUTPUT_CHAR('r');
137 }
138 /* write escaped line feeds */
139 else if (*pch == 10)
140 {
141 UNITY_OUTPUT_CHAR('\\');
142 UNITY_OUTPUT_CHAR('n');
143 }
144 /* unprintable characters are shown as codes */
145 else
146 {
147 UNITY_OUTPUT_CHAR('\\');
148 UNITY_OUTPUT_CHAR('x');
149 UnityPrintNumberHex((UNITY_UINT)*pch, 2);
150 }
151 pch++;
152 }
153 }
154}
155
156/*-----------------------------------------------*/
157void UnityPrintNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T style)

Callers 1

Calls 1

UnityPrintNumberHexFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…