From cd85f60a10c364af470bda60ab6abb72a08ffbef Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Mon, 7 Sep 2020 16:32:20 +0900 Subject: [PATCH] tests: fix DSWaylandClient-test Change-Id: I2e478d09b0a3b0ed38416e2e7572ca8f2c1016c3 Signed-off-by: Sung-Jin Park --- tests/DSWaylandClient-test.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/tests/DSWaylandClient-test.cpp b/tests/DSWaylandClient-test.cpp index e08707f..329cff9 100644 --- a/tests/DSWaylandClient-test.cpp +++ b/tests/DSWaylandClient-test.cpp @@ -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; } -- 2.7.4