提交 943fef8a 编写于 作者: J jsalling

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.
上级 36ee2d21
...@@ -140,7 +140,7 @@ void UnityMalloc_EndTest(void) ...@@ -140,7 +140,7 @@ void UnityMalloc_EndTest(void)
malloc_fail_countdown = MALLOC_DONT_FAIL; malloc_fail_countdown = MALLOC_DONT_FAIL;
if (malloc_count != 0) 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) ...@@ -247,7 +247,7 @@ void unity_free(void* mem)
release_memory(mem); release_memory(mem);
if (overrun) 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) ...@@ -270,7 +270,7 @@ void* unity_realloc(void* oldMem, size_t size)
if (isOverrun(oldMem)) if (isOverrun(oldMem))
{ {
release_memory(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) if (size == 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册