diff --git a/extras/fixture/test/unity_fixture_Test.c b/extras/fixture/test/unity_fixture_Test.c index 0527fbe..2a16e2d 100644 --- a/extras/fixture/test/unity_fixture_Test.c +++ b/extras/fixture/test/unity_fixture_Test.c @@ -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) { } diff --git a/extras/fixture/test/unity_fixture_TestRunner.c b/extras/fixture/test/unity_fixture_TestRunner.c index bc0bf5a..e0b5684 100644 --- a/extras/fixture/test/unity_fixture_TestRunner.c +++ b/extras/fixture/test/unity_fixture_TestRunner.c @@ -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)