提交 36ee2d21 编写于 作者: J jsalling

Add test for setting max number of pointers in Fixture

上级 822a537d
......@@ -422,6 +422,26 @@ TEST(LeakDetection, BufferGuardWriteFoundDuringRealloc)
#endif
}
TEST(LeakDetection, PointerSettingMax)
{
#ifndef USING_OUTPUT_SPY
UNITY_PRINT_EOL();
TEST_IGNORE();
#else
int i;
for (i = 0; i < 50; i++) UT_PTR_SET(pointer1, &int1);
UnityOutputCharSpy_Enable(1);
EXPECT_ABORT_BEGIN
UT_PTR_SET(pointer1, &int1);
EXPECT_ABORT_END
UnityOutputCharSpy_Enable(0);
Unity.CurrentTestFailed = 0;
CHECK(strstr(UnityOutputCharSpy_Get(), "Too many pointers set"));
#endif
}
//------------------------------------------------------------
TEST_GROUP(InternalMalloc);
TEST_SETUP(InternalMalloc) { }
......
......@@ -42,6 +42,7 @@ TEST_GROUP_RUNNER(LeakDetection)
RUN_TEST_CASE(LeakDetection, BufferOverrunFoundDuringRealloc);
RUN_TEST_CASE(LeakDetection, BufferGuardWriteFoundDuringFree);
RUN_TEST_CASE(LeakDetection, BufferGuardWriteFoundDuringRealloc);
RUN_TEST_CASE(LeakDetection, PointerSettingMax);
}
TEST_GROUP_RUNNER(InternalMalloc)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册