configure unity a bit

This commit is contained in:
hathach 2013-01-27 16:26:25 +07:00
parent 9a1bda1633
commit b57e6e1121
2 changed files with 35 additions and 32 deletions

View File

@ -53,38 +53,39 @@ void UnityPrintOk(void);
void UnityPrint(const char* string) void UnityPrint(const char* string)
{ {
const char* pch = string; // const char* pch = string;
//
if (pch != NULL) // if (pch != NULL)
{ // {
while (*pch) // while (*pch)
{ // {
// printable characters plus CR & LF are printed // // printable characters plus CR & LF are printed
if ((*pch <= 126) && (*pch >= 32)) // if ((*pch <= 126) && (*pch >= 32))
{ // {
UNITY_OUTPUT_CHAR(*pch); // UNITY_OUTPUT_CHAR(*pch);
} // }
//write escaped carriage returns // //write escaped carriage returns
else if (*pch == 13) // else if (*pch == 13)
{ // {
UNITY_OUTPUT_CHAR('\\'); // UNITY_OUTPUT_CHAR('\\');
UNITY_OUTPUT_CHAR('r'); // UNITY_OUTPUT_CHAR('r');
} // }
//write escaped line feeds // //write escaped line feeds
else if (*pch == 10) // else if (*pch == 10)
{ // {
UNITY_OUTPUT_CHAR('\\'); // UNITY_OUTPUT_CHAR('\\');
UNITY_OUTPUT_CHAR('n'); // UNITY_OUTPUT_CHAR('n');
} // }
// unprintable characters are shown as codes // // unprintable characters are shown as codes
else // else
{ // {
UNITY_OUTPUT_CHAR('\\'); // UNITY_OUTPUT_CHAR('\\');
UnityPrintNumberHex((_U_SINT)*pch, 2); // UnityPrintNumberHex((_U_SINT)*pch, 2);
} // }
pch++; // pch++;
} // }
} // }
printf (string);
} }
//----------------------------------------------- //-----------------------------------------------

View File

@ -8,6 +8,8 @@
#define UNITY_FRAMEWORK_H #define UNITY_FRAMEWORK_H
#define UNITY #define UNITY
#define UNITY_EXCLUDE_FLOAT
#define UNITY_EXCLUDE_DOUBLE
#include "unity_internals.h" #include "unity_internals.h"