mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-12-18 06:18:37 +08:00
84
src/unity.c
84
src/unity.c
@@ -7,10 +7,8 @@
|
|||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#ifdef AVR
|
#ifndef UNITY_PROGMEM
|
||||||
#include <avr/pgmspace.h>
|
#define UNITY_PROGMEM
|
||||||
#else
|
|
||||||
#define PROGMEM
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* If omitted from header, declare overrideable prototypes here so they're ready for use */
|
/* If omitted from header, declare overrideable prototypes here so they're ready for use */
|
||||||
@@ -26,50 +24,50 @@ void UNITY_OUTPUT_CHAR(int);
|
|||||||
struct UNITY_STORAGE_T Unity;
|
struct UNITY_STORAGE_T Unity;
|
||||||
|
|
||||||
#ifdef UNITY_OUTPUT_COLOR
|
#ifdef UNITY_OUTPUT_COLOR
|
||||||
const char PROGMEM UnityStrOk[] = "\033[42mOK\033[0m";
|
const char UNITY_PROGMEM UnityStrOk[] = "\033[42mOK\033[0m";
|
||||||
const char PROGMEM UnityStrPass[] = "\033[42mPASS\033[0m";
|
const char UNITY_PROGMEM UnityStrPass[] = "\033[42mPASS\033[0m";
|
||||||
const char PROGMEM UnityStrFail[] = "\033[41mFAIL\033[0m";
|
const char UNITY_PROGMEM UnityStrFail[] = "\033[41mFAIL\033[0m";
|
||||||
const char PROGMEM UnityStrIgnore[] = "\033[43mIGNORE\033[0m";
|
const char UNITY_PROGMEM UnityStrIgnore[] = "\033[43mIGNORE\033[0m";
|
||||||
#else
|
#else
|
||||||
const char PROGMEM UnityStrOk[] = "OK";
|
const char UNITY_PROGMEM UnityStrOk[] = "OK";
|
||||||
const char PROGMEM UnityStrPass[] = "PASS";
|
const char UNITY_PROGMEM UnityStrPass[] = "PASS";
|
||||||
const char PROGMEM UnityStrFail[] = "FAIL";
|
const char UNITY_PROGMEM UnityStrFail[] = "FAIL";
|
||||||
const char PROGMEM UnityStrIgnore[] = "IGNORE";
|
const char UNITY_PROGMEM UnityStrIgnore[] = "IGNORE";
|
||||||
#endif
|
#endif
|
||||||
static const char PROGMEM UnityStrNull[] = "NULL";
|
static const char UNITY_PROGMEM UnityStrNull[] = "NULL";
|
||||||
static const char PROGMEM UnityStrSpacer[] = ". ";
|
static const char UNITY_PROGMEM UnityStrSpacer[] = ". ";
|
||||||
static const char PROGMEM UnityStrExpected[] = " Expected ";
|
static const char UNITY_PROGMEM UnityStrExpected[] = " Expected ";
|
||||||
static const char PROGMEM UnityStrWas[] = " Was ";
|
static const char UNITY_PROGMEM UnityStrWas[] = " Was ";
|
||||||
static const char PROGMEM UnityStrGt[] = " to be greater than ";
|
static const char UNITY_PROGMEM UnityStrGt[] = " to be greater than ";
|
||||||
static const char PROGMEM UnityStrLt[] = " to be less than ";
|
static const char UNITY_PROGMEM UnityStrLt[] = " to be less than ";
|
||||||
static const char PROGMEM UnityStrOrEqual[] = "or equal to ";
|
static const char UNITY_PROGMEM UnityStrOrEqual[] = "or equal to ";
|
||||||
static const char PROGMEM UnityStrNotEqual[] = " to be not equal to ";
|
static const char UNITY_PROGMEM UnityStrNotEqual[] = " to be not equal to ";
|
||||||
static const char PROGMEM UnityStrElement[] = " Element ";
|
static const char UNITY_PROGMEM UnityStrElement[] = " Element ";
|
||||||
static const char PROGMEM UnityStrByte[] = " Byte ";
|
static const char UNITY_PROGMEM UnityStrByte[] = " Byte ";
|
||||||
static const char PROGMEM UnityStrMemory[] = " Memory Mismatch.";
|
static const char UNITY_PROGMEM UnityStrMemory[] = " Memory Mismatch.";
|
||||||
static const char PROGMEM UnityStrDelta[] = " Values Not Within Delta ";
|
static const char UNITY_PROGMEM UnityStrDelta[] = " Values Not Within Delta ";
|
||||||
static const char PROGMEM UnityStrPointless[] = " You Asked Me To Compare Nothing, Which Was Pointless.";
|
static const char UNITY_PROGMEM UnityStrPointless[] = " You Asked Me To Compare Nothing, Which Was Pointless.";
|
||||||
static const char PROGMEM UnityStrNullPointerForExpected[] = " Expected pointer to be NULL";
|
static const char UNITY_PROGMEM UnityStrNullPointerForExpected[] = " Expected pointer to be NULL";
|
||||||
static const char PROGMEM UnityStrNullPointerForActual[] = " Actual pointer was NULL";
|
static const char UNITY_PROGMEM UnityStrNullPointerForActual[] = " Actual pointer was NULL";
|
||||||
#ifndef UNITY_EXCLUDE_FLOAT
|
#ifndef UNITY_EXCLUDE_FLOAT
|
||||||
static const char PROGMEM UnityStrNot[] = "Not ";
|
static const char UNITY_PROGMEM UnityStrNot[] = "Not ";
|
||||||
static const char PROGMEM UnityStrInf[] = "Infinity";
|
static const char UNITY_PROGMEM UnityStrInf[] = "Infinity";
|
||||||
static const char PROGMEM UnityStrNegInf[] = "Negative Infinity";
|
static const char UNITY_PROGMEM UnityStrNegInf[] = "Negative Infinity";
|
||||||
static const char PROGMEM UnityStrNaN[] = "NaN";
|
static const char UNITY_PROGMEM UnityStrNaN[] = "NaN";
|
||||||
static const char PROGMEM UnityStrDet[] = "Determinate";
|
static const char UNITY_PROGMEM UnityStrDet[] = "Determinate";
|
||||||
static const char PROGMEM UnityStrInvalidFloatTrait[] = "Invalid Float Trait";
|
static const char UNITY_PROGMEM UnityStrInvalidFloatTrait[] = "Invalid Float Trait";
|
||||||
#endif
|
#endif
|
||||||
const char PROGMEM UnityStrErrShorthand[] = "Unity Shorthand Support Disabled";
|
const char UNITY_PROGMEM UnityStrErrShorthand[] = "Unity Shorthand Support Disabled";
|
||||||
const char PROGMEM UnityStrErrFloat[] = "Unity Floating Point Disabled";
|
const char UNITY_PROGMEM UnityStrErrFloat[] = "Unity Floating Point Disabled";
|
||||||
const char PROGMEM UnityStrErrDouble[] = "Unity Double Precision Disabled";
|
const char UNITY_PROGMEM UnityStrErrDouble[] = "Unity Double Precision Disabled";
|
||||||
const char PROGMEM UnityStrErr64[] = "Unity 64-bit Support Disabled";
|
const char UNITY_PROGMEM UnityStrErr64[] = "Unity 64-bit Support Disabled";
|
||||||
static const char PROGMEM UnityStrBreaker[] = "-----------------------";
|
static const char UNITY_PROGMEM UnityStrBreaker[] = "-----------------------";
|
||||||
static const char PROGMEM UnityStrResultsTests[] = " Tests ";
|
static const char UNITY_PROGMEM UnityStrResultsTests[] = " Tests ";
|
||||||
static const char PROGMEM UnityStrResultsFailures[] = " Failures ";
|
static const char UNITY_PROGMEM UnityStrResultsFailures[] = " Failures ";
|
||||||
static const char PROGMEM UnityStrResultsIgnored[] = " Ignored ";
|
static const char UNITY_PROGMEM UnityStrResultsIgnored[] = " Ignored ";
|
||||||
#ifndef UNITY_EXCLUDE_DETAILS
|
#ifndef UNITY_EXCLUDE_DETAILS
|
||||||
static const char PROGMEM UnityStrDetail1Name[] = UNITY_DETAIL1_NAME " ";
|
static const char UNITY_PROGMEM UnityStrDetail1Name[] = UNITY_DETAIL1_NAME " ";
|
||||||
static const char PROGMEM UnityStrDetail2Name[] = " " UNITY_DETAIL2_NAME " ";
|
static const char UNITY_PROGMEM UnityStrDetail2Name[] = " " UNITY_DETAIL2_NAME " ";
|
||||||
#endif
|
#endif
|
||||||
/*-----------------------------------------------
|
/*-----------------------------------------------
|
||||||
* Pretty Printers & Test Result Output Handlers
|
* Pretty Printers & Test Result Output Handlers
|
||||||
|
|||||||
Reference in New Issue
Block a user