From 943fef8a1793fc24f3195c3468355a5a27816c8c Mon Sep 17 00:00:00 2001 From: jsalling Date: Tue, 9 Feb 2016 10:39:22 -0600 Subject: [PATCH] Fix printing the test line number for leak detection failures in Fixture The old failure would print the line in unity_fixture.c, not very useful. Now using CurrentTestLineNumber, which is better. --- extras/fixture/src/unity_fixture.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extras/fixture/src/unity_fixture.c b/extras/fixture/src/unity_fixture.c index cdcf382..67ce6fe 100644 --- a/extras/fixture/src/unity_fixture.c +++ b/extras/fixture/src/unity_fixture.c @@ -140,7 +140,7 @@ void UnityMalloc_EndTest(void) malloc_fail_countdown = MALLOC_DONT_FAIL; if (malloc_count != 0) { - TEST_FAIL_MESSAGE("This test leaks!"); + UNITY_TEST_FAIL(Unity.CurrentTestLineNumber, "This test leaks!"); } } @@ -247,7 +247,7 @@ void unity_free(void* mem) release_memory(mem); if (overrun) { - TEST_FAIL_MESSAGE("Buffer overrun detected during free()"); + UNITY_TEST_FAIL(Unity.CurrentTestLineNumber, "Buffer overrun detected during free()"); } } @@ -270,7 +270,7 @@ void* unity_realloc(void* oldMem, size_t size) if (isOverrun(oldMem)) { release_memory(oldMem); - TEST_FAIL_MESSAGE("Buffer overrun detected during realloc()"); + UNITY_TEST_FAIL(Unity.CurrentTestLineNumber, "Buffer overrun detected during realloc()"); } if (size == 0)