1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-30 11:44:27 +01:00

Add configuration option UNITY_EXCLUDE_STDLIB_MALLOC to Fixture

This feature removes the dependency on malloc/free for constrained
  embedded systems without a heap. It uses a static heap inside
  Unity Fixture. Setting UNITY_INTERNAL_HEAP_SIZE_BYTES sizes the heap.
 Add tests for new option, add targets to makefile for running tests.
 UNITY_FIXTURE_MALLOC for Fixture use only, remove from unity_output_Spy.c.
This commit is contained in:
jsalling
2016-02-01 23:54:06 -06:00
parent ccb29e80c2
commit 955b221218
7 changed files with 139 additions and 15 deletions

View File

@@ -22,7 +22,7 @@ void UnityOutputCharSpy_Create(int s)
size = s;
count = 0;
spy_enable = 0;
buffer = UNITY_FIXTURE_MALLOC(size);
buffer = malloc(size);
TEST_ASSERT_NOT_NULL_MESSAGE(buffer, "Internal malloc failed in Spy Create():" __FILE__);
memset(buffer, 0, size);
}
@@ -30,7 +30,7 @@ void UnityOutputCharSpy_Create(int s)
void UnityOutputCharSpy_Destroy(void)
{
size = 0;
UNITY_FIXTURE_FREE(buffer);
free(buffer);
}
int UnityOutputCharSpy_OutputChar(int c)