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

Function UnityPrint

tests/unity/src/unity.c:70–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68 *-----------------------------------------------*/
69
70void 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
119void UnityPrintLen(const char* string, const UNITY_UINT32 length)
120{

Callers 15

tearDownFunction · 0.85
tearDownFunction · 0.85
UnityPrintFloatFunction · 0.85
UnityTestResultsBeginFunction · 0.85
UnityConcludeTestFunction · 0.85
UnityAddMsgIfSpecifiedFunction · 0.85
UnityIsOneArrayNullFunction · 0.85
UnityAssertBitsFunction · 0.85

Calls 1

UnityPrintNumberHexFunction · 0.85

Tested by 3

tearDownFunction · 0.68
tearDownFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…