- 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:
Mark VanderVoord
2015-12-07 21:41:44 -05:00
parent 90813a3e78
commit 9aeaee26c9
3 changed files with 15 additions and 11 deletions

View File

@ -117,7 +117,7 @@ void UnityTestRunner(unityfunction* setup,
void UnityIgnoreTest(const char * printableName, const char * group, const char * name)
{
if (testSelected(name) && groupSelected(group))
if (testSelected(name) && groupSelected(group))
{
Unity.NumberOfTests++;
Unity.CurrentTestIgnored = 1;
@ -291,7 +291,7 @@ typedef struct _PointerPair
} PointerPair;
enum {MAX_POINTERS=50};
static PointerPair pointer_store[MAX_POINTERS];
static PointerPair pointer_store[MAX_POINTERS+1];
static int pointer_index = 0;
void UnityPointer_Init(void)
@ -302,12 +302,16 @@ void UnityPointer_Init(void)
void UnityPointer_Set(void ** pointer, void * newValue)
{
if (pointer_index >= MAX_POINTERS)
{
TEST_FAIL_MESSAGE("Too many pointers set");
pointer_store[pointer_index].pointer = pointer;
pointer_store[pointer_index].old_value = *pointer;
*pointer = newValue;
pointer_index++;
}
else
{
pointer_store[pointer_index].pointer = pointer;
pointer_store[pointer_index].old_value = *pointer;
*pointer = newValue;
pointer_index++;
}
}
void UnityPointer_UndoAllSets(void)