From 0636ba5765a4c1a63ae85e4baa2cdaeff5f13e6e Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Tue, 25 Jul 2023 07:26:37 +0100 Subject: [PATCH] Update windowManagerTest.cpp test to see if segfault triggers at this point in testing --- Engine/source/testing/windowManagerTest.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Engine/source/testing/windowManagerTest.cpp b/Engine/source/testing/windowManagerTest.cpp index d15e8dcce..408ce4acb 100644 --- a/Engine/source/testing/windowManagerTest.cpp +++ b/Engine/source/testing/windowManagerTest.cpp @@ -42,24 +42,29 @@ protected: // for tests in this class we probably only need the init_video an nothing else. SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_EVENTS | SDL_INIT_NOPARACHUTE); + + pwm = static_cast(CreatePlatformWindowManager()); } void SetUp() override { } + + PlatformWindowManagerSDL* pwm; + + void TearDown() override + { + delete pwm; + } }; TEST_F(PlatformWindowManagerSDLTest, Constructor) { - PlatformWindowManagerSDL* pwm = static_cast(CreatePlatformWindowManager()); - ASSERT_TRUE(pwm) << "no monitor to test against!"; } TEST_F(PlatformWindowManagerSDLTest, PrimaryRectTest) { - PlatformWindowManagerSDL* pwm = static_cast(CreatePlatformWindowManager()); - // Check out the primary desktop area... RectI primary = pwm->getPrimaryDesktopArea(); @@ -69,8 +74,6 @@ TEST_F(PlatformWindowManagerSDLTest, PrimaryRectTest) TEST_F(PlatformWindowManagerSDLTest, MonitorRectsValid) { - PlatformWindowManagerSDL* pwm = static_cast(CreatePlatformWindowManager()); - // Now try to get info about all the monitors. Vector monitorRects; pwm->getMonitorRegions(monitorRects); @@ -85,8 +88,6 @@ TEST_F(PlatformWindowManagerSDLTest, MonitorRectsValid) TEST_F(PlatformWindowManagerSDLTest, MonitorRectsAtLeastOne) { - PlatformWindowManagerSDL* pwm = static_cast(CreatePlatformWindowManager()); - // Now try to get info about all the monitors. Vector monitorRects; pwm->getMonitorRegions(monitorRects); @@ -97,8 +98,6 @@ TEST_F(PlatformWindowManagerSDLTest, MonitorRectsAtLeastOne) TEST_F(PlatformWindowManagerSDLTest, MonitorRectsOverflow) { - PlatformWindowManagerSDL* pwm = static_cast(CreatePlatformWindowManager()); - // Now try to get info about all the monitors. Vector monitorRects; pwm->getMonitorRegions(monitorRects);