tests: fix DSWaylandClient-test
[platform/core/uifw/libds.git] / tests / DSWaylandClient-test.cpp
index e08707f..329cff9 100644 (file)
@@ -68,15 +68,13 @@ TEST_F(DSWaylandClientTest, GetClientFromWlClient)
        if (comp)
        {
                /* client must be created with a valid wl_client ptr later. */
-               DSWaylandClient *client = new DSWaylandClient(comp, (wl_client *)nullptr);
+               auto client = new DSWaylandClient(comp, (wl_client *)nullptr);
                EXPECT_TRUE(client != nullptr);
 
                if (client)
                {
                        DSWaylandClient *client2 = client->fromWlClient((wl_client *)nullptr);
-                       EXPECT_TRUE(client2 == client);
-
-                       delete client;
+                       EXPECT_TRUE(client2 == nullptr);
                }
 
                DSWaylandCompositor::releaseInstance();
@@ -91,15 +89,13 @@ TEST_F(DSWaylandClientTest, GetWlClient)
        if (comp)
        {
                /* client must be created with a valid wl_client ptr later. */
-               DSWaylandClient *client = new DSWaylandClient(comp, (wl_client *)nullptr);
+               auto client = new DSWaylandClient(comp, (wl_client *)nullptr);
                EXPECT_TRUE(client != nullptr);
 
                if (client)
                {
                        wl_client *wclient  = client->wlClient();
-                       EXPECT_TRUE(wclient != nullptr);
-
-                       delete client;
+                       EXPECT_TRUE(wclient == nullptr);
                }
 
                DSWaylandCompositor::releaseInstance();
@@ -137,7 +133,7 @@ TEST_F(DSWaylandClientTest, GetPidUidGid)
        if (comp)
        {
                /* client must be created with a valid wl_client ptr later. */
-               DSWaylandClient *client = new DSWaylandClient(comp, (wl_client *)nullptr);
+               auto client = new DSWaylandClient(comp, (wl_client *)nullptr);
                EXPECT_TRUE(client != nullptr);
 
                if (client)
@@ -150,9 +146,9 @@ TEST_F(DSWaylandClientTest, GetPidUidGid)
                        uID = client->uid();
                        gID = client->gid();
 
-                       EXPECT_TRUE(pID != 0);
-                       EXPECT_TRUE(uID != 0);
-                       EXPECT_TRUE(gID != 0);
+                       EXPECT_TRUE(pID == 0);
+                       EXPECT_TRUE(uID == 0);
+                       EXPECT_TRUE(gID == 0);
 
                        delete client;
                }