1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-23 00:15:58 +01:00

Add test for setting max number of pointers in Fixture

This commit is contained in:
jsalling
2016-02-09 10:36:33 -06:00
parent 822a537d2e
commit 36ee2d2111
2 changed files with 21 additions and 0 deletions

View File

@@ -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) { }

View File

@@ -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)