vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c in ceedling-0.25.0 vs vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c in ceedling-0.27.0
- old
+ new
@@ -3,13 +3,13 @@
* Unity Project - A Test Framework for C
* Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
* [Released under MIT License. Please refer to license.txt for details]
* ========================================== */
-#include <string.h>
#include "unity_fixture.h"
#include "unity_internals.h"
+#include <string.h>
struct UNITY_FIXTURE_T UnityFixture;
/* If you decide to use the function pointer approach.
* Build with -D UNITY_OUTPUT_CHAR=outputChar and include <stdio.h>
@@ -69,21 +69,27 @@
unityfunction* testBody,
unityfunction* teardown,
const char* printableName,
const char* group,
const char* name,
- const char* file, unsigned int line)
+ const char* file,
+ unsigned int line)
{
if (testSelected(name) && groupSelected(group))
{
Unity.TestFile = file;
Unity.CurrentTestName = printableName;
Unity.CurrentTestLineNumber = line;
if (!UnityFixture.Verbose)
UNITY_OUTPUT_CHAR('.');
else
+ {
UnityPrint(printableName);
+ #ifndef UNITY_REPEAT_TEST_NAME
+ Unity.CurrentTestName = NULL;
+ #endif
+ }
Unity.NumberOfTests++;
UnityMalloc_StartTest();
UnityPointer_Init();
@@ -191,11 +197,11 @@
{
guard = NULL;
}
else
{
- guard = (Guard*) &unity_heap[heap_index];
+ guard = (Guard*)&unity_heap[heap_index];
heap_index += total_size;
}
#else
guard = (Guard*)UNITY_FIXTURE_MALLOC(total_size);
#endif
@@ -283,11 +289,11 @@
#ifdef UNITY_EXCLUDE_STDLIB_MALLOC /* Optimization if memory is expandable */
if (oldMem == unity_heap + heap_index - guard->size - sizeof(end) &&
heap_index + size - guard->size <= UNITY_INTERNAL_HEAP_SIZE_BYTES)
{
- release_memory(oldMem); /* Not thread-safe, like unity_heap generally */
+ release_memory(oldMem); /* Not thread-safe, like unity_heap generally */
return unity_malloc(size); /* No memcpy since data is in place */
}
#endif
newMem = unity_malloc(size);
if (newMem == NULL) return NULL; /* Do not release old memory */
@@ -303,22 +309,21 @@
{
void** pointer;
void* old_value;
};
-enum { MAX_POINTERS = 50 };
-static struct PointerPair pointer_store[MAX_POINTERS];
+static struct PointerPair pointer_store[UNITY_MAX_POINTERS];
static int pointer_index = 0;
void UnityPointer_Init(void)
{
pointer_index = 0;
}
void UnityPointer_Set(void** pointer, void* newValue, UNITY_LINE_TYPE line)
{
- if (pointer_index >= MAX_POINTERS)
+ if (pointer_index >= UNITY_MAX_POINTERS)
{
UNITY_TEST_FAIL(line, "Too many pointers set");
}
else
{
@@ -389,10 +394,12 @@
UnityFixture.RepeatCount += (unsigned int)argv[i][digit++] - '0';
}
i++;
}
}
- } else {
+ }
+ else
+ {
/* ignore unknown parameter */
i++;
}
}
return 0;