Update windowManagerTest.cpp

test to see if segfault triggers at this point in testing
This commit is contained in:
marauder2k7 2023-07-25 07:26:37 +01:00
parent ce36ea6c0b
commit 0636ba5765

View file

@ -42,24 +42,29 @@ protected:
// for tests in this class we probably only need the init_video an nothing else. // 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); SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_EVENTS | SDL_INIT_NOPARACHUTE);
pwm = static_cast<PlatformWindowManagerSDL*>(CreatePlatformWindowManager());
} }
void SetUp() override void SetUp() override
{ {
} }
PlatformWindowManagerSDL* pwm;
void TearDown() override
{
delete pwm;
}
}; };
TEST_F(PlatformWindowManagerSDLTest, Constructor) TEST_F(PlatformWindowManagerSDLTest, Constructor)
{ {
PlatformWindowManagerSDL* pwm = static_cast<PlatformWindowManagerSDL*>(CreatePlatformWindowManager());
ASSERT_TRUE(pwm) << "no monitor to test against!"; ASSERT_TRUE(pwm) << "no monitor to test against!";
} }
TEST_F(PlatformWindowManagerSDLTest, PrimaryRectTest) TEST_F(PlatformWindowManagerSDLTest, PrimaryRectTest)
{ {
PlatformWindowManagerSDL* pwm = static_cast<PlatformWindowManagerSDL*>(CreatePlatformWindowManager());
// Check out the primary desktop area... // Check out the primary desktop area...
RectI primary = pwm->getPrimaryDesktopArea(); RectI primary = pwm->getPrimaryDesktopArea();
@ -69,8 +74,6 @@ TEST_F(PlatformWindowManagerSDLTest, PrimaryRectTest)
TEST_F(PlatformWindowManagerSDLTest, MonitorRectsValid) TEST_F(PlatformWindowManagerSDLTest, MonitorRectsValid)
{ {
PlatformWindowManagerSDL* pwm = static_cast<PlatformWindowManagerSDL*>(CreatePlatformWindowManager());
// Now try to get info about all the monitors. // Now try to get info about all the monitors.
Vector<RectI> monitorRects; Vector<RectI> monitorRects;
pwm->getMonitorRegions(monitorRects); pwm->getMonitorRegions(monitorRects);
@ -85,8 +88,6 @@ TEST_F(PlatformWindowManagerSDLTest, MonitorRectsValid)
TEST_F(PlatformWindowManagerSDLTest, MonitorRectsAtLeastOne) TEST_F(PlatformWindowManagerSDLTest, MonitorRectsAtLeastOne)
{ {
PlatformWindowManagerSDL* pwm = static_cast<PlatformWindowManagerSDL*>(CreatePlatformWindowManager());
// Now try to get info about all the monitors. // Now try to get info about all the monitors.
Vector<RectI> monitorRects; Vector<RectI> monitorRects;
pwm->getMonitorRegions(monitorRects); pwm->getMonitorRegions(monitorRects);
@ -97,8 +98,6 @@ TEST_F(PlatformWindowManagerSDLTest, MonitorRectsAtLeastOne)
TEST_F(PlatformWindowManagerSDLTest, MonitorRectsOverflow) TEST_F(PlatformWindowManagerSDLTest, MonitorRectsOverflow)
{ {
PlatformWindowManagerSDL* pwm = static_cast<PlatformWindowManagerSDL*>(CreatePlatformWindowManager());
// Now try to get info about all the monitors. // Now try to get info about all the monitors.
Vector<RectI> monitorRects; Vector<RectI> monitorRects;
pwm->getMonitorRegions(monitorRects); pwm->getMonitorRegions(monitorRects);