mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-28 18:54:27 +01:00
Add test for setting max number of pointers in Fixture
This commit is contained in:
@@ -422,6 +422,26 @@ TEST(LeakDetection, BufferGuardWriteFoundDuringRealloc)
|
|||||||
#endif
|
#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_GROUP(InternalMalloc);
|
||||||
|
|
||||||
TEST_SETUP(InternalMalloc) { }
|
TEST_SETUP(InternalMalloc) { }
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ TEST_GROUP_RUNNER(LeakDetection)
|
|||||||
RUN_TEST_CASE(LeakDetection, BufferOverrunFoundDuringRealloc);
|
RUN_TEST_CASE(LeakDetection, BufferOverrunFoundDuringRealloc);
|
||||||
RUN_TEST_CASE(LeakDetection, BufferGuardWriteFoundDuringFree);
|
RUN_TEST_CASE(LeakDetection, BufferGuardWriteFoundDuringFree);
|
||||||
RUN_TEST_CASE(LeakDetection, BufferGuardWriteFoundDuringRealloc);
|
RUN_TEST_CASE(LeakDetection, BufferGuardWriteFoundDuringRealloc);
|
||||||
|
RUN_TEST_CASE(LeakDetection, PointerSettingMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_GROUP_RUNNER(InternalMalloc)
|
TEST_GROUP_RUNNER(InternalMalloc)
|
||||||
|
|||||||
Reference in New Issue
Block a user