tests: fix DSWaylandClient-test 75/243475/1
authorSung-Jin Park <sj76.park@samsung.com>
Mon, 7 Sep 2020 07:32:20 +0000 (16:32 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Mon, 7 Sep 2020 10:53:55 +0000 (19:53 +0900)
Change-Id: I2e478d09b0a3b0ed38416e2e7572ca8f2c1016c3
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
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;
                }