TEST_F(DSWaylandTizenInputDeviceManagerTest, NewDSWaylandTizenInputDeviceManager)
{
DSWaylandCompositor *compositor = DSWaylandCompositor::getInstance();
- DSWaylandTizenInputDeviceManager *inputDeviceManager = new DSWaylandTizenInputDeviceManager(compositor);
- delete inputDeviceManager;
- DSWaylandCompositor::releaseInstance();
- EXPECT_TRUE(true);
+ EXPECT_TRUE(compositor != nullptr);
+
+ if (compositor)
+ {
+ DSWaylandTizenInputDeviceManager *inputDeviceManager = new DSWaylandTizenInputDeviceManager(compositor);
+ EXPECT_TRUE(inputDeviceManager != nullptr);
+
+ if (inputDeviceManager)
+ delete inputDeviceManager;
+
+ DSWaylandCompositor::releaseInstance();
+ }
}
TEST_F(DSWaylandTizenInputDeviceManagerTest, getTizenInputDevice)
{
DSWaylandCompositor *compositor = DSWaylandCompositor::getInstance();
- DSWaylandTizenInputDeviceManager *inputDeviceManager = new DSWaylandTizenInputDeviceManager(compositor);
- EXPECT_TRUE(inputDeviceManager->getTizenInputDevice());
- delete inputDeviceManager;
- DSWaylandCompositor::releaseInstance();
+ EXPECT_TRUE(compositor != nullptr);
+
+ if (compositor)
+ {
+ DSWaylandTizenInputDeviceManager *inputDeviceManager = new DSWaylandTizenInputDeviceManager(compositor);
+ EXPECT_TRUE(inputDeviceManager != nullptr);
+
+ if (inputDeviceManager)
+ {
+ EXPECT_TRUE(inputDeviceManager->getTizenInputDevice());
+
+ delete inputDeviceManager;
+ }
+
+ DSWaylandCompositor::releaseInstance();
+ }
}