mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-06-25 18:57:58 +08:00
- Cleaned up UnitPointer_Set (thanks Eric)
- Cleaned up a casting warning error - Removed a couple semicolons from the end of macros SHAME!
This commit is contained in:
@ -117,7 +117,7 @@ void UnityTestRunner(unityfunction* setup,
|
|||||||
|
|
||||||
void UnityIgnoreTest(const char * printableName, const char * group, const char * name)
|
void UnityIgnoreTest(const char * printableName, const char * group, const char * name)
|
||||||
{
|
{
|
||||||
if (testSelected(name) && groupSelected(group))
|
if (testSelected(name) && groupSelected(group))
|
||||||
{
|
{
|
||||||
Unity.NumberOfTests++;
|
Unity.NumberOfTests++;
|
||||||
Unity.CurrentTestIgnored = 1;
|
Unity.CurrentTestIgnored = 1;
|
||||||
@ -291,7 +291,7 @@ typedef struct _PointerPair
|
|||||||
} PointerPair;
|
} PointerPair;
|
||||||
|
|
||||||
enum {MAX_POINTERS=50};
|
enum {MAX_POINTERS=50};
|
||||||
static PointerPair pointer_store[MAX_POINTERS];
|
static PointerPair pointer_store[MAX_POINTERS+1];
|
||||||
static int pointer_index = 0;
|
static int pointer_index = 0;
|
||||||
|
|
||||||
void UnityPointer_Init(void)
|
void UnityPointer_Init(void)
|
||||||
@ -302,12 +302,16 @@ void UnityPointer_Init(void)
|
|||||||
void UnityPointer_Set(void ** pointer, void * newValue)
|
void UnityPointer_Set(void ** pointer, void * newValue)
|
||||||
{
|
{
|
||||||
if (pointer_index >= MAX_POINTERS)
|
if (pointer_index >= MAX_POINTERS)
|
||||||
|
{
|
||||||
TEST_FAIL_MESSAGE("Too many pointers set");
|
TEST_FAIL_MESSAGE("Too many pointers set");
|
||||||
|
}
|
||||||
pointer_store[pointer_index].pointer = pointer;
|
else
|
||||||
pointer_store[pointer_index].old_value = *pointer;
|
{
|
||||||
*pointer = newValue;
|
pointer_store[pointer_index].pointer = pointer;
|
||||||
pointer_index++;
|
pointer_store[pointer_index].old_value = *pointer;
|
||||||
|
*pointer = newValue;
|
||||||
|
pointer_index++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnityPointer_UndoAllSets(void)
|
void UnityPointer_UndoAllSets(void)
|
||||||
|
@ -188,7 +188,7 @@ void UnityPrintNumber(const _U_SINT number_to_print)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// figure out initial divisor
|
// figure out initial divisor
|
||||||
while (number / divisor > 9)
|
while ((_U_SINT)number / divisor > 9)
|
||||||
{
|
{
|
||||||
next_divisor = divisor * 10;
|
next_divisor = divisor * 10;
|
||||||
if (next_divisor > divisor)
|
if (next_divisor > divisor)
|
||||||
@ -200,7 +200,7 @@ void UnityPrintNumber(const _U_SINT number_to_print)
|
|||||||
// now mod and print, then divide divisor
|
// now mod and print, then divide divisor
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
UNITY_OUTPUT_CHAR((char)('0' + (number / divisor % 10)));
|
UNITY_OUTPUT_CHAR((char)('0' + ((_U_SINT)number / divisor % 10)));
|
||||||
divisor /= 10;
|
divisor /= 10;
|
||||||
}
|
}
|
||||||
while (divisor > 0);
|
while (divisor > 0);
|
||||||
|
@ -593,8 +593,8 @@ extern const char UnityStrErr64[];
|
|||||||
// Basic Fail and Ignore
|
// Basic Fail and Ignore
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
|
||||||
#define UNITY_TEST_FAIL(line, message) UnityFail( (message), (UNITY_LINE_TYPE)(line));
|
#define UNITY_TEST_FAIL(line, message) UnityFail( (message), (UNITY_LINE_TYPE)(line))
|
||||||
#define UNITY_TEST_IGNORE(line, message) UnityIgnore( (message), (UNITY_LINE_TYPE)(line));
|
#define UNITY_TEST_IGNORE(line, message) UnityIgnore( (message), (UNITY_LINE_TYPE)(line))
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
// Test Asserts
|
// Test Asserts
|
||||||
|
Reference in New Issue
Block a user