From a82ae9901e9f90931285aedd32dab7738bce7be3 Mon Sep 17 00:00:00 2001 From: jeon Date: Wed, 2 Sep 2020 16:41:10 +0900 Subject: [PATCH 01/16] DSWaylandTouch: set LCOV_EXCL blocks Change-Id: I13787d8976ab0c59e523207eef93737272e3c04c --- src/DSWaylandServer/DSWaylandTouch.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/DSWaylandServer/DSWaylandTouch.cpp b/src/DSWaylandServer/DSWaylandTouch.cpp index 2f011dc..4044a6b 100644 --- a/src/DSWaylandServer/DSWaylandTouch.cpp +++ b/src/DSWaylandServer/DSWaylandTouch.cpp @@ -98,6 +98,7 @@ void DSWaylandTouchPrivate::touch_release(Resource *resource) wl_resource_destroy(resource->handle); } +/*LCOV_EXCL_START*/ void DSWaylandTouchPrivate::sendDown(int32_t id, int x, int y) { if (!__waylandSurface) @@ -127,6 +128,7 @@ void DSWaylandTouchPrivate::sendMotion(int32_t id, int x, int y) send_motion(__wlTouchResource, __seat->getCurrentEventTime(), id, x_fixed, y_fixed); } +/*LCOV_EXCL_STOP*/ /* Begin Public Class Implementation */ DSWaylandTouch::DSWaylandTouch(DSWaylandSeat *seat) @@ -175,6 +177,7 @@ DSWaylandSurface *DSWaylandTouch::getFocus() return priv->getFocus(); } +/*LCOV_EXCL_START*/ void DSWaylandTouch::sendDown(int32_t id, int x, int y) { DS_GET_PRIV(DSWaylandTouch); @@ -192,5 +195,6 @@ void DSWaylandTouch::sendMotion(int32_t id, int x, int y) DS_GET_PRIV(DSWaylandTouch); priv->sendMotion(id, x, y); } +/*LCOV_EXCL_STOP*/ } -- 2.7.4 From 0948dda481f95f7e7556e7fa9d868ad53c9f2d7c Mon Sep 17 00:00:00 2001 From: jeon Date: Wed, 2 Sep 2020 16:55:56 +0900 Subject: [PATCH 02/16] tests: add ResetFocus test for DSWaylandPointer Change-Id: I1fed15d212e1b191387df10d599a698950bab665 --- tests/DSWaylandPointer-test.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/DSWaylandPointer-test.cpp b/tests/DSWaylandPointer-test.cpp index 05cf9c0..0156b07 100644 --- a/tests/DSWaylandPointer-test.cpp +++ b/tests/DSWaylandPointer-test.cpp @@ -91,3 +91,15 @@ TEST_F(DSWaylandPointerTest, SetGetFocus) } } +TEST_F(DSWaylandPointerTest, ResetFocus) +{ + auto pointer = new DSWaylandPointer(nullptr); + EXPECT_TRUE(pointer != nullptr); + + if (pointer) + { + pointer->resetFocus(); + EXPECT_TRUE(nullptr == pointer->getFocus()); + } +} + -- 2.7.4 From e096b720467b4f7fe55575e388f99b86f72eb6ac Mon Sep 17 00:00:00 2001 From: jeon Date: Wed, 2 Sep 2020 16:56:11 +0900 Subject: [PATCH 03/16] set LCOV_EXCL blocks Change-Id: Ia4cbb03555a32f2e1bd082038718c096d2c27e0e --- src/DSWaylandServer/DSWaylandPointer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/DSWaylandServer/DSWaylandPointer.cpp b/src/DSWaylandServer/DSWaylandPointer.cpp index f298c43..3ed7813 100644 --- a/src/DSWaylandServer/DSWaylandPointer.cpp +++ b/src/DSWaylandServer/DSWaylandPointer.cpp @@ -101,6 +101,7 @@ DSWaylandSurface *DSWaylandPointerPrivate::getFocus() return __waylandSurface; } +/*LCOV_EXCL_START*/ void DSWaylandPointerPrivate::pointer_bind_resource(Resource *resource) { DSLOG_INF("DSWaylandPointerPrivate",""); @@ -159,6 +160,7 @@ void DSWaylandPointerPrivate::sendButton(uint32_t button, uint32_t state) send_button(__wlPointerResource, __compositor->nextSerial(), __seat->getCurrentEventTime(), button, state); } +/*LCOV_EXCL_STOP*/ /* Begin Public Class Implementation */ DSWaylandPointer::DSWaylandPointer(DSWaylandSeat *seat) @@ -179,6 +181,7 @@ DSWaylandSeat *DSWaylandPointer::seat() return priv->__seat; } +/*LCOV_EXCL_START*/ void DSWaylandPointer::addClient(DSWaylandClient *client, uint32_t id, int version) { DS_GET_PRIV(DSWaylandPointer); @@ -187,6 +190,7 @@ void DSWaylandPointer::addClient(DSWaylandClient *client, uint32_t id, int versi priv->add(client->wlClient(), id, version); } +/*LCOV_EXCL_STOP*/ void DSWaylandPointer::setFocus(DSWaylandSurface *waylandSurface) { @@ -207,6 +211,7 @@ DSWaylandSurface *DSWaylandPointer::getFocus() return priv->getFocus(); } +/*LCOV_EXCL_START*/ void DSWaylandPointer::sendEnter(int surface_x, int surface_y) { DS_GET_PRIV(DSWaylandPointer); @@ -236,5 +241,6 @@ void DSWaylandPointer::sendButtonUp(uint32_t button) DS_GET_PRIV(DSWaylandPointer); priv->sendButton(button, WL_POINTER_BUTTON_STATE_RELEASED); } +/*LCOV_EXCL_STOP*/ } -- 2.7.4 From e300400a8df4940dc302f1ec06a64b8eddfce0cb Mon Sep 17 00:00:00 2001 From: jeon Date: Wed, 2 Sep 2020 16:56:32 +0900 Subject: [PATCH 04/16] tests: add Reset Focus test for DSWaylandKeyboard Change-Id: I828a59c134e361472247bad33da34b05b53f0886 --- tests/DSWaylandKeyboard-test.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/DSWaylandKeyboard-test.cpp b/tests/DSWaylandKeyboard-test.cpp index 3254f4f..5a15f67 100644 --- a/tests/DSWaylandKeyboard-test.cpp +++ b/tests/DSWaylandKeyboard-test.cpp @@ -128,3 +128,15 @@ TEST_F(DSWaylandKeyboardTest, BasicMethods) } } +TEST_F(DSWaylandKeyboardTest, ResetFocus) +{ + auto keyboard = new DSWaylandKeyboard(nullptr); + EXPECT_TRUE(keyboard != nullptr); + + if (keyboard) + { + keyboard->resetFocus(); + EXPECT_TRUE(nullptr == keyboard->getFocus()); + } +} + -- 2.7.4 From 2f999fdcf53424c0fe8acb365daa895b2cd83dad Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Wed, 2 Sep 2020 18:54:58 +0900 Subject: [PATCH 05/16] DSZone-test: renew some testcases and add new testcase for DSZone API Change-Id: I8e3b43fb6b5c9cc453206550654ffa0361981cf3 Signed-off-by: Junseok, Kim --- tests/DSZone-test.cpp | 222 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 206 insertions(+), 16 deletions(-) diff --git a/tests/DSZone-test.cpp b/tests/DSZone-test.cpp index 7e69b18..e12b2ef 100644 --- a/tests/DSZone-test.cpp +++ b/tests/DSZone-test.cpp @@ -115,10 +115,10 @@ TEST_F(DSZoneTest, NewDSZone) EXPECT_TRUE(zone != nullptr); } -TEST_F(DSZoneTest, BasicMethods) +TEST_F(DSZoneTest, SetGetPosition) { auto zone = std::make_unique(); - EXPECT_TRUE(zone != nullptr); + ASSERT_NE(zone, nullptr) << "Failed to create DSZone"; stPosition position1; position1.x = 10; @@ -127,8 +127,14 @@ TEST_F(DSZoneTest, BasicMethods) stPosition position2; position2 = zone->getPosition(); - EXPECT_TRUE(position1.x == position2.x); - EXPECT_TRUE(position1.y == position2.y); + EXPECT_TRUE(position1.x == position2.x) << "didn't match position X"; + EXPECT_TRUE(position1.y == position2.y) << "didn't match position Y"; +} + +TEST_F(DSZoneTest, SetGetSize) +{ + auto zone = std::make_unique(); + ASSERT_NE(zone, nullptr) << "Failed to create DSZone"; stSize size1; size1.w = 100; @@ -137,17 +143,17 @@ TEST_F(DSZoneTest, BasicMethods) stSize size2; size2 = zone->getSize(); - EXPECT_TRUE(size1.w == size2.w); - EXPECT_TRUE(size1.h == size2.h); + EXPECT_TRUE(size1.w == size2.w) << "didn't match size W"; + EXPECT_TRUE(size1.h == size2.h) << "didn't match size H"; } TEST_F(DSZoneTest, registerCallbackWindowCreated) { auto zone = std::make_shared(); - EXPECT_TRUE(zone != nullptr); + ASSERT_TRUE(zone != nullptr); auto testZone = std::make_shared(zone); - EXPECT_TRUE(testZone != nullptr); + ASSERT_TRUE(testZone != nullptr); testZone->callOnWindowCreated(); EXPECT_TRUE(testZone->getResultOnWindowCreated()); @@ -156,10 +162,10 @@ TEST_F(DSZoneTest, registerCallbackWindowCreated) TEST_F(DSZoneTest, registerCallbackWindowShellCreated) { auto zone = std::make_shared(); - EXPECT_TRUE(zone != nullptr); + ASSERT_TRUE(zone != nullptr); auto testZone = std::make_shared(zone); - EXPECT_TRUE(testZone != nullptr); + ASSERT_TRUE(testZone != nullptr); // before calling WindowShell created EXPECT_FALSE(testZone->getResultOnWindowShellCreated()); @@ -170,22 +176,21 @@ TEST_F(DSZoneTest, registerCallbackWindowShellCreated) EXPECT_TRUE(testZone->getResultOnWindowShellCreated()); } -TEST_F(DSZoneTest, stackChanged) +TEST_F(DSZoneTest, stackChangedRaiseLower) { int count; auto zone = std::make_shared(); - EXPECT_TRUE(zone != nullptr); + ASSERT_TRUE(zone != nullptr); auto testZone = std::make_shared(zone); - - EXPECT_TRUE(testZone != nullptr); + ASSERT_TRUE(testZone != nullptr); auto dswlSurface1 = std::make_shared(); - EXPECT_TRUE(zone->testCreateWindow(dswlSurface1)); + ASSERT_TRUE(zone->testCreateWindow(dswlSurface1)); auto dswlSurface2 = std::make_shared(); - EXPECT_TRUE(zone->testCreateWindow(dswlSurface2)); + ASSERT_TRUE(zone->testCreateWindow(dswlSurface2)); count = testZone->getWindowCount(); for (std::shared_ptr w : zone->getWindowList()) @@ -202,5 +207,190 @@ TEST_F(DSZoneTest, stackChanged) EXPECT_TRUE(w.get() == testZone->myWindow[count]); count++; } + + zone->lowerWindow(dswlSurface1.get()); + + count = testZone->getWindowCount(); + for (std::shared_ptr w : zone->getWindowList()) + { + EXPECT_TRUE(w.get() == testZone->myWindow[count-1]); + count--; + } +} + +TEST_F(DSZoneTest, stackChangedActivate) +{ + int count; + + auto zone = std::make_shared(); + ASSERT_NE(zone, nullptr) << "Failed to create DSZone"; + + auto testZone = std::make_shared(zone); + ASSERT_NE(testZone, nullptr) << "Failed to create TestZone"; + + auto dswlSurface1 = std::make_shared(); + ASSERT_TRUE(zone->testCreateWindow(dswlSurface1)); + + auto dswlSurface2 = std::make_shared(); + ASSERT_TRUE(zone->testCreateWindow(dswlSurface2)); + + count = testZone->getWindowCount(); + for (std::shared_ptr w : zone->getWindowList()) + { + EXPECT_TRUE(w.get() == testZone->myWindow[count-1]); + count--; + } + + zone->activateWindow(dswlSurface1.get()); + + count = 0; + for (std::shared_ptr w : zone->getWindowList()) + { + EXPECT_TRUE(w.get() == testZone->myWindow[count]); + count++; + } +} + +TEST_F(DSZoneTest, SetWindowParent) +{ + auto zone = std::make_shared(); + ASSERT_NE(zone, nullptr) << "Failed to create DSZone"; + + auto testZone = std::make_shared(zone); + ASSERT_NE(testZone, nullptr) << "Failed to create TestZone"; + + auto dswlSurface1 = std::make_shared(); + ASSERT_TRUE(zone->testCreateWindow(dswlSurface1)) << "Failed to create test window1"; + + auto dswlSurface2 = std::make_shared(); + ASSERT_TRUE(zone->testCreateWindow(dswlSurface2)) << "Failed to create test window2"; + + EXPECT_TRUE(zone->setWindowParent(dswlSurface1.get(), dswlSurface2.get())) << "Failed to set window parent"; +} + +TEST_F(DSZoneTest, SetWindowType) +{ + auto zone = std::make_shared(); + ASSERT_NE(zone, nullptr) << "Failed to create DSZone"; + + auto testZone = std::make_shared(zone); + ASSERT_NE(testZone, nullptr) << "Failed to create TestZone"; + + auto dswlSurface1 = std::make_shared(); + ASSERT_TRUE(zone->testCreateWindow(dswlSurface1)) << "Failed to create test window1"; + + EXPECT_TRUE(zone->setWindowType(dswlSurface1.get(), 1)) << "Failed to set window type"; +} + +TEST_F(DSZoneTest, SetGetWindowGeometry) +{ + auto zone = std::make_shared(); + ASSERT_NE(zone, nullptr) << "Failed to create DSZone"; + + auto testZone = std::make_shared(zone); + ASSERT_NE(testZone, nullptr) << "Failed to create TestZone"; + + auto dswlSurface1 = std::make_shared(); + ASSERT_TRUE(zone->testCreateWindow(dswlSurface1)) << "Failed to create test window1"; + + // set window geometry + EXPECT_TRUE(zone->setWindowGeometry(dswlSurface1.get(), 11, 22, 33, 44)) << "Failed to set window type"; + + // get window geometry + stGeometry geom; + geom = zone->getWindowGeometry(dswlSurface1.get()); + EXPECT_NE(geom.x, 11) << "didn't match geometry X"; + EXPECT_NE(geom.y, 22) << "didn't match geometry Y"; + EXPECT_NE(geom.w, 33) << "didn't match geometry W"; + EXPECT_NE(geom.h, 44) << "didn't match geometry H"; +} + +TEST_F(DSZoneTest, SetWindowPosition) +{ + auto zone = std::make_shared(); + ASSERT_NE(zone, nullptr) << "Failed to create DSZone"; + + auto testZone = std::make_shared(zone); + ASSERT_NE(testZone, nullptr) << "Failed to create TestZone"; + + auto dswlSurface1 = std::make_shared(); + ASSERT_TRUE(zone->testCreateWindow(dswlSurface1)) << "Failed to create test window1"; + + // set window position + EXPECT_TRUE(zone->setWindowPosition(dswlSurface1.get(), 11, 22)) << "Failed to set window type"; + + // get window geometry + stGeometry geom; + geom = zone->getWindowGeometry(dswlSurface1.get()); + EXPECT_NE(geom.x, 11) << "didn't match geometry X"; + EXPECT_NE(geom.y, 22) << "didn't match geometry Y"; +} + +TEST_F(DSZoneTest, WindowAuxHint) +{ + auto zone = std::make_shared(); + ASSERT_NE(zone, nullptr) << "Failed to create DSZone"; + + auto testZone = std::make_shared(zone); + ASSERT_NE(testZone, nullptr) << "Failed to create TestZone"; + + auto dswlSurface1 = std::make_shared(); + ASSERT_TRUE(zone->testCreateWindow(dswlSurface1)) << "Failed to create test window1"; + + // TODO: need to add verity method + + // add test aux hint + zone->addWindowAuxHint(dswlSurface1.get(), 1, "test.aux.hint", "1"); + + // change aux hint value + zone->changeWindowAuxHint(dswlSurface1.get(), 1, "0"); + + // remove aux hint value + zone->removeWindowAuxHint(dswlSurface1.get(), 1); +} + +TEST_F(DSZoneTest, SetWindowSkipFocus) +{ + auto zone = std::make_shared(); + ASSERT_NE(zone, nullptr) << "Failed to create DSZone"; + + auto testZone = std::make_shared(zone); + ASSERT_NE(testZone, nullptr) << "Failed to create TestZone"; + + auto dswlSurface1 = std::make_shared(); + ASSERT_TRUE(zone->testCreateWindow(dswlSurface1)) << "Failed to create test window1"; + + // TODO: need to add verity method + zone->setWindowSkipFocus(dswlSurface1.get(), true); +} + +TEST_F(DSZoneTest, SetGetVkbdFloating) +{ + auto zone = std::make_shared(); + ASSERT_NE(zone, nullptr) << "Failed to create DSZone"; + + auto testZone = std::make_shared(zone); + ASSERT_NE(testZone, nullptr) << "Failed to create TestZone"; + + auto dswlSurface1 = std::make_shared(); + ASSERT_TRUE(zone->testCreateWindow(dswlSurface1)) << "Failed to create test window1"; + + EXPECT_TRUE(zone->setWindowVkbdFloating(dswlSurface1.get(), true)) << "Failed to set window vkbd floating"; + + EXPECT_TRUE(zone->getWindowVkbdFloating(dswlSurface1.get())) << "didn't matching vkbd floating value"; } +TEST_F(DSZoneTest, SetWindowAllowUserGeometry) +{ + auto zone = std::make_shared(); + ASSERT_NE(zone, nullptr) << "Failed to create DSZone"; + + auto testZone = std::make_shared(zone); + ASSERT_NE(testZone, nullptr) << "Failed to create TestZone"; + + auto dswlSurface1 = std::make_shared(); + ASSERT_TRUE(zone->testCreateWindow(dswlSurface1)) << "Failed to create test window1"; + + // TODO: need to add verity method + zone->setWindowAllowUserGeometry(dswlSurface1.get(), true); +} \ No newline at end of file -- 2.7.4 From e56386f9004f3dc85d49301badeb4c66300c5373 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Wed, 2 Sep 2020 19:57:57 +0900 Subject: [PATCH 06/16] DSBufferRef: do not use DSBufferRefPrivate class Change-Id: I4b01742125392d45f4bfe2807d1e14db9732b4fb --- src/DSBuffer/DSBufferRef.cpp | 26 ++++----------------- src/DSBuffer/DSBufferRef.h | 9 ++++--- src/DSBuffer/DSBufferRefPrivate.h | 49 --------------------------------------- src/meson.build | 1 - 4 files changed, 8 insertions(+), 77 deletions(-) delete mode 100644 src/DSBuffer/DSBufferRefPrivate.h diff --git a/src/DSBuffer/DSBufferRef.cpp b/src/DSBuffer/DSBufferRef.cpp index 2dce15e..01c38cc 100644 --- a/src/DSBuffer/DSBufferRef.cpp +++ b/src/DSBuffer/DSBufferRef.cpp @@ -22,41 +22,23 @@ */ #include "DSBufferRef.h" -#include "DSBufferRefPrivate.h" #include "DSDebugLog.h" namespace display_server { DSBufferRef::DSBufferRef(std::shared_ptr dsBuffer) - : _d_ptr(std::make_unique(this, dsBuffer)) -{} - -DSBufferRef::~DSBufferRef() -{} - -std::shared_ptr DSBufferRef::refDSBufferGet() -{ - DS_GET_PRIV(DSBufferRef); - - return priv->refDSBufferGet(); -} - -DSBufferRefPrivate::DSBufferRefPrivate(DSBufferRef *p_ptr, std::shared_ptr dsBuffer) - : DSObjectPrivate(p_ptr), - __p_ptr(p_ptr), - __dsBuffer(dsBuffer) + : __dsBuffer(dsBuffer) { __dsBuffer->ref(); } -DSBufferRefPrivate::~DSBufferRefPrivate() +DSBufferRef::~DSBufferRef() { - if (__dsBuffer) - __dsBuffer->unref(); + __dsBuffer->unref(); } -std::shared_ptr DSBufferRefPrivate::refDSBufferGet() +std::shared_ptr DSBufferRef::refDSBufferGet() { return __dsBuffer; } diff --git a/src/DSBuffer/DSBufferRef.h b/src/DSBuffer/DSBufferRef.h index b96d016..a56d38c 100644 --- a/src/DSBuffer/DSBufferRef.h +++ b/src/DSBuffer/DSBufferRef.h @@ -25,22 +25,21 @@ #define __DS_BUFFER_REF_H__ #include -#include #include namespace display_server { -class DSBufferRefPrivate; - -class DSBufferRef : public DSObject +class DSBufferRef { -DS_PIMPL_USE_PRIVATE(DSBufferRef); public: explicit DSBufferRef(std::shared_ptr dsBuffer); virtual ~DSBufferRef(); std::shared_ptr refDSBufferGet(); + +private: + std::shared_ptr __dsBuffer; }; } diff --git a/src/DSBuffer/DSBufferRefPrivate.h b/src/DSBuffer/DSBufferRefPrivate.h deleted file mode 100644 index 40f1fb2..0000000 --- a/src/DSBuffer/DSBufferRefPrivate.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -* Copyright © 2020 Samsung Electronics co., Ltd. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -* DEALINGS IN THE SOFTWARE. -*/ - -#ifndef __DS_BUFFER_REF_PRIVATE_H__ -#define __DS_BUFFER_REF_PRIVATE_H__ - -#include "DSBufferRef.h" - -namespace display_server -{ - -class DSBufferRefPrivate : public DSObjectPrivate -{ - DS_PIMPL_USE_PUBLIC(DSBufferRef); -public: - DSBufferRefPrivate() = delete; - DSBufferRefPrivate(DSBufferRef *p_ptr, std::shared_ptr dsBuffer); - - ~DSBufferRefPrivate(); - - std::shared_ptr refDSBufferGet(); - -private: - std::shared_ptr __dsBuffer; -}; - -} - -#endif diff --git a/src/meson.build b/src/meson.build index 9ebeb3e..b786585 100644 --- a/src/meson.build +++ b/src/meson.build @@ -9,7 +9,6 @@ libds_srcs = [ 'DSBuffer/DSBufferManagerPrivate.h', 'DSBuffer/DSBufferRef.cpp', 'DSBuffer/DSBufferRef.h', - 'DSBuffer/DSBufferRefPrivate.h', 'DSCallback/DSCallback.h', 'DSCanvas/DSCanvas.cpp', 'DSCompositor/DSCompositor.cpp', -- 2.7.4 From c5c4c339d07ed795c6f95dfa985693402d70afdd Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Wed, 2 Sep 2020 20:14:56 +0900 Subject: [PATCH 07/16] DSDebug: Added LCOV_EXCL to whole code Change-Id: I814cb5980098b8f38292017f84cf69447d9e8790 Signed-off-by: Junseok, Kim --- src/DSDebug/DSDebugLog.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/DSDebug/DSDebugLog.cpp b/src/DSDebug/DSDebugLog.cpp index bd579df..f6e3581 100644 --- a/src/DSDebug/DSDebugLog.cpp +++ b/src/DSDebug/DSDebugLog.cpp @@ -33,6 +33,8 @@ namespace display_server { +/*LCOV_EXCL_START*/ + DSDebugLog::DSDebugLog() : mLogLevel(LOG_LEVEL_DEBUG), __enableDlog(false) { char *tmp = getenv("DSLOG_DLOG_ENABLE"); @@ -106,4 +108,5 @@ int DSDebugLog::getLogLevel() return mLogLevel; } +/*LCOV_EXCL_STOP*/ } // namespace display_serer -- 2.7.4 From 9b53ca1b0bebab1c9e82041b205debdf2b5704f3 Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Wed, 2 Sep 2020 21:38:23 +0900 Subject: [PATCH 08/16] DSWaylandServer: swap tizen_policy_ext files to tizen-policy-ext The tizen_policy_ext protocol renamed as tizen-policy-ext and merged into wayland-extension. So, adjust like that Change-Id: I0b585e3c9f505429d1c7f45a6e519605ce0fa6f5 Signed-off-by: Junseok, Kim --- .../DSWaylandTizenPolicyExtPrivate.h | 2 +- ...t.cpp => dswayland-server-tizen-policy-ext.cpp} | 14 +- ...y_ext.h => dswayland-server-tizen-policy-ext.h} | 5 +- src/DSWaylandServer/tizen_policy_ext-protocol.c | 54 -------- .../tizen_policy_ext-server-protocol.h | 151 --------------------- src/meson.build | 9 +- 6 files changed, 13 insertions(+), 222 deletions(-) rename src/DSWaylandServer/{dswayland-server-tizen_policy_ext.cpp => dswayland-server-tizen-policy-ext.cpp} (98%) rename src/DSWaylandServer/{dswayland-server-tizen_policy_ext.h => dswayland-server-tizen-policy-ext.h} (98%) delete mode 100644 src/DSWaylandServer/tizen_policy_ext-protocol.c delete mode 100644 src/DSWaylandServer/tizen_policy_ext-server-protocol.h diff --git a/src/DSWaylandServer/DSWaylandTizenPolicyExtPrivate.h b/src/DSWaylandServer/DSWaylandTizenPolicyExtPrivate.h index cfa4e79..74ce5f6 100644 --- a/src/DSWaylandServer/DSWaylandTizenPolicyExtPrivate.h +++ b/src/DSWaylandServer/DSWaylandTizenPolicyExtPrivate.h @@ -24,7 +24,7 @@ #ifndef _DS_WAYLAND_TIZEN_POLICY_EXT_PRIVATE_H_ #define _DS_WAYLAND_TIZEN_POLICY_EXT_PRIVATE_H_ -#include "dswayland-server-tizen_policy_ext.h" +#include "dswayland-server-tizen-policy-ext.h" #include "DSWaylandTizenPolicyExt.h" namespace display_server diff --git a/src/DSWaylandServer/dswayland-server-tizen_policy_ext.cpp b/src/DSWaylandServer/dswayland-server-tizen-policy-ext.cpp similarity index 98% rename from src/DSWaylandServer/dswayland-server-tizen_policy_ext.cpp rename to src/DSWaylandServer/dswayland-server-tizen-policy-ext.cpp index 97e129e..590d2d7 100644 --- a/src/DSWaylandServer/dswayland-server-tizen_policy_ext.cpp +++ b/src/DSWaylandServer/dswayland-server-tizen-policy-ext.cpp @@ -1,8 +1,6 @@ -/* Protocol XML file : wayland-extension/tizen_policy_ext.xml */ +/* Protocol XML file : wayland-extension/tizen-policy-ext.xml */ -#include -#include "tizen_policy_ext-server-protocol.h" -#include "dswayland-server-tizen_policy_ext.h" +#include "dswayland-server-tizen-policy-ext.h" #ifndef DS_UNLIKELY #define DS_UNLIKELY(X) X @@ -107,7 +105,7 @@ namespace DSWaylandServer { void tizen_policy_ext::init(struct ::wl_display *display, int version) { - m_global = wl_global_create(display, &::tizen_policy_ext_interface3, version, this, bind_func); + m_global = wl_global_create(display, &::tizen_policy_ext_interface, version, this, bind_func); m_globalVersion = version; m_displayDestroyedListener.notify = tizen_policy_ext::display_destroy_func; m_displayDestroyedListener.parent = this; @@ -116,7 +114,7 @@ namespace DSWaylandServer { const struct wl_interface *tizen_policy_ext::interface() { - return &::tizen_policy_ext_interface3; + return &::tizen_policy_ext_interface; } tizen_policy_ext::Resource *tizen_policy_ext::tizen_policy_ext_allocate() @@ -158,7 +156,7 @@ namespace DSWaylandServer { tizen_policy_ext::Resource *tizen_policy_ext::bind(struct ::wl_client *client, uint32_t id, int version) { DS_ASSERT_X(!wl_client_get_object(client, id), "DSWaylandObject bind", "binding to object %u more than once", id); - struct ::wl_resource *handle = wl_resource_create(client, &::tizen_policy_ext_interface3, version, id); + struct ::wl_resource *handle = wl_resource_create(client, &::tizen_policy_ext_interface, version, id); return bind(handle); } @@ -176,7 +174,7 @@ namespace DSWaylandServer { { if (DS_UNLIKELY(!resource)) return NULL; - if (wl_resource_instance_of(resource, &::tizen_policy_ext_interface3, &m_tizen_policy_ext_interface)) + if (wl_resource_instance_of(resource, &::tizen_policy_ext_interface, &m_tizen_policy_ext_interface)) return static_cast(wl_resource_get_user_data(resource)); return NULL; } diff --git a/src/DSWaylandServer/dswayland-server-tizen_policy_ext.h b/src/DSWaylandServer/dswayland-server-tizen-policy-ext.h similarity index 98% rename from src/DSWaylandServer/dswayland-server-tizen_policy_ext.h rename to src/DSWaylandServer/dswayland-server-tizen-policy-ext.h index 9069fe7..e1ee610 100644 --- a/src/DSWaylandServer/dswayland-server-tizen_policy_ext.h +++ b/src/DSWaylandServer/dswayland-server-tizen-policy-ext.h @@ -1,11 +1,10 @@ -/* Protocol XML file : wayland-extension/tizen_policy_ext.xml */ +/* Protocol XML file : wayland-extension/tizen-policy-ext.xml */ #ifndef __DS_TIZEN_POLICY_EXT_PROTOCOL_H__ #define __DS_TIZEN_POLICY_EXT_PROTOCOL_H__ #include "wayland-server-core.h" -#include -#include "tizen_policy_ext-server-protocol.h" +#include "tizen-policy-ext-server-protocol.h" #include #include #include diff --git a/src/DSWaylandServer/tizen_policy_ext-protocol.c b/src/DSWaylandServer/tizen_policy_ext-protocol.c deleted file mode 100644 index 6b49f50..0000000 --- a/src/DSWaylandServer/tizen_policy_ext-protocol.c +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include -#include "wayland-util.h" - -extern const struct wl_interface tizen_rotation_interface; -extern const struct wl_interface wl_surface_interface; - -static const struct wl_interface *types[] = { - NULL, - NULL, - NULL, - NULL, - NULL, - &tizen_rotation_interface, - &wl_surface_interface, - &wl_surface_interface, -}; - -static const struct wl_message tizen_policy_ext_requests[] = { - { "get_rotation", "no", types + 5 }, - { "get_active_angle", "?o", types + 7 }, -}; - -static const struct wl_message tizen_policy_ext_events[] = { - { "active_angle", "u", types + 0 }, -}; - -WL_EXPORT const struct wl_interface tizen_policy_ext_interface3 = { - "tizen_policy_ext", 3, - 2, tizen_policy_ext_requests, - 1, tizen_policy_ext_events, -}; - -static const struct wl_message tizen_rotation_requests[] = { - { "destroy", "", types + 0 }, - { "set_available_angles", "u", types + 0 }, - { "set_preferred_angle", "u", types + 0 }, - { "ack_angle_change", "u", types + 0 }, - { "set_geometry_hint", "3uuuuu", types + 0 }, -}; - -static const struct wl_message tizen_rotation_events[] = { - { "available_angles_done", "u", types + 0 }, - { "preferred_angle_done", "u", types + 0 }, - { "angle_change", "uu", types + 0 }, - { "angle_change_with_resize", "2uuuu", types + 0 }, -}; - -WL_EXPORT const struct wl_interface tizen_rotation_interface = { - "tizen_rotation", 3, - 5, tizen_rotation_requests, - 4, tizen_rotation_events, -}; - diff --git a/src/DSWaylandServer/tizen_policy_ext-server-protocol.h b/src/DSWaylandServer/tizen_policy_ext-server-protocol.h deleted file mode 100644 index 4a08b79..0000000 --- a/src/DSWaylandServer/tizen_policy_ext-server-protocol.h +++ /dev/null @@ -1,151 +0,0 @@ -#ifndef TIZEN_POLICY_EXT_SERVER_PROTOCOL_H -#define TIZEN_POLICY_EXT_SERVER_PROTOCOL_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include "wayland-server.h" - -struct wl_client; -struct wl_resource; - -struct tizen_policy_ext; -struct tizen_rotation; -struct wl_surface; - -extern const struct wl_interface tizen_policy_ext_interface3; -extern const struct wl_interface tizen_rotation_interface; - -struct tizen_policy_ext_interface { - /** - * get_rotation - (none) - * @id: new rotation object - * @surface: surface object - */ - void (*get_rotation)(struct wl_client *client, - struct wl_resource *resource, - uint32_t id, - struct wl_resource *surface); - /** - * get_active_angle - get a current active angle - * @surface: (none) - * - * - */ - void (*get_active_angle)(struct wl_client *client, - struct wl_resource *resource, - struct wl_resource *surface); -}; - -#define TIZEN_POLICY_EXT_ACTIVE_ANGLE 0 - -#define TIZEN_POLICY_EXT_ACTIVE_ANGLE_SINCE_VERSION 1 - -static inline void -tizen_policy_ext_send_active_angle(struct wl_resource *resource_, uint32_t angle) -{ - wl_resource_post_event(resource_, TIZEN_POLICY_EXT_ACTIVE_ANGLE, angle); -} - -#ifndef TIZEN_ROTATION_ANGLE_ENUM -#define TIZEN_ROTATION_ANGLE_ENUM -enum tizen_rotation_angle { - TIZEN_ROTATION_ANGLE_NONE = 0, - TIZEN_ROTATION_ANGLE_0 = 1, - TIZEN_ROTATION_ANGLE_90 = 2, - TIZEN_ROTATION_ANGLE_180 = 4, - TIZEN_ROTATION_ANGLE_270 = 8, -}; -#endif /* TIZEN_ROTATION_ANGLE_ENUM */ - -struct tizen_rotation_interface { - /** - * destroy - destroy tizen_rotation - * - * - */ - void (*destroy)(struct wl_client *client, - struct wl_resource *resource); - /** - * set_available_angles - (none) - * @angles: (none) - */ - void (*set_available_angles)(struct wl_client *client, - struct wl_resource *resource, - uint32_t angles); - /** - * set_preferred_angle - (none) - * @angle: (none) - */ - void (*set_preferred_angle)(struct wl_client *client, - struct wl_resource *resource, - uint32_t angle); - /** - * ack_angle_change - ack a angle_change - * @serial: a serial to angle_change for - * - * - */ - void (*ack_angle_change)(struct wl_client *client, - struct wl_resource *resource, - uint32_t serial); - /** - * set_geometry_hint - (none) - * @angle: (none) - * @x: (none) - * @y: (none) - * @width: (none) - * @height: (none) - * @since: 3 - */ - void (*set_geometry_hint)(struct wl_client *client, - struct wl_resource *resource, - uint32_t angle, - uint32_t x, - uint32_t y, - uint32_t w, - uint32_t h); -}; - -#define TIZEN_ROTATION_AVAILABLE_ANGLES_DONE 0 -#define TIZEN_ROTATION_PREFERRED_ANGLE_DONE 1 -#define TIZEN_ROTATION_ANGLE_CHANGE 2 -#define TIZEN_ROTATION_ANGLE_CHANGE_WITH_RESIZE 3 - -#define TIZEN_ROTATION_AVAILABLE_ANGLES_DONE_SINCE_VERSION 1 -#define TIZEN_ROTATION_PREFERRED_ANGLE_DONE_SINCE_VERSION 1 -#define TIZEN_ROTATION_ANGLE_CHANGE_SINCE_VERSION 1 -#define TIZEN_ROTATION_ANGLE_CHANGE_WITH_RESIZE_SINCE_VERSION 2 - -static inline void -tizen_rotation_send_available_angles_done(struct wl_resource *resource_, uint32_t angles) -{ - wl_resource_post_event(resource_, TIZEN_ROTATION_AVAILABLE_ANGLES_DONE, angles); -} - -static inline void -tizen_rotation_send_preferred_angle_done(struct wl_resource *resource_, uint32_t angle) -{ - wl_resource_post_event(resource_, TIZEN_ROTATION_PREFERRED_ANGLE_DONE, angle); -} - -static inline void -tizen_rotation_send_angle_change(struct wl_resource *resource_, uint32_t angle, uint32_t serial) -{ - wl_resource_post_event(resource_, TIZEN_ROTATION_ANGLE_CHANGE, angle, serial); -} - -static inline void -tizen_rotation_send_angle_change_with_resize(struct wl_resource *resource_, uint32_t angle, uint32_t serial, uint32_t width, uint32_t height) -{ - wl_resource_post_event(resource_, TIZEN_ROTATION_ANGLE_CHANGE_WITH_RESIZE, angle, serial, width, height); -} - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/meson.build b/src/meson.build index b786585..5b39ed4 100644 --- a/src/meson.build +++ b/src/meson.build @@ -100,8 +100,8 @@ libds_wayland_srcs = [ 'DSWaylandServer/dswayland-server-tizen-launch.h', 'DSWaylandServer/dswayland-server-input-method.cpp', 'DSWaylandServer/dswayland-server-input-method.h', - 'DSWaylandServer/dswayland-server-tizen_policy_ext.cpp', - 'DSWaylandServer/dswayland-server-tizen_policy_ext.h', + 'DSWaylandServer/dswayland-server-tizen-policy-ext.cpp', + 'DSWaylandServer/dswayland-server-tizen-policy-ext.h', 'DSWaylandServer/DSWaylandCallback.cpp', 'DSWaylandServer/DSWaylandCallback.h', 'DSWaylandServer/DSWaylandCallbackPrivate.h', @@ -186,8 +186,6 @@ libds_wayland_srcs = [ 'DSWaylandServer/DSWaylandTizenPolicyExt.h', 'DSWaylandServer/DSWaylandTizenPolicyExtPrivate.h', 'DSWaylandServer/DSWaylandTizenPolicyExt.cpp', - 'DSWaylandServer/tizen_policy_ext-server-protocol.h', - 'DSWaylandServer/tizen_policy_ext-protocol.c', ] libds_srcs += libds_wayland_srcs @@ -217,6 +215,7 @@ tizen_surface_dep = dependency('tizen-surface-server') input_method_dep = dependency('input-method-server') text_dep = dependency('text-server') tizen_launch_dep = dependency('tizen-launch-server') +tizen_policy_ext_dep = dependency('tizen-policy-ext-server') dali_core_dep = dependency('dali2-core') dali_adaptor_dep = dependency('dali2-adaptor') @@ -224,7 +223,7 @@ dali_toolkit_dep = dependency('dali2-toolkit') dali_deps = [dali_core_dep, dali_adaptor_dep, dali_toolkit_dep] tizen_ext_deps = [tizen_ext_dep, input_method_dep, text_dep, tizen_launch_dep, tizen_surface_dep] -tizen_ext_deps = [tizen_ext_deps, xdg_shell_unstable_v6_dep, xdg_shell_dep] +tizen_ext_deps += [xdg_shell_unstable_v6_dep, xdg_shell_dep, tizen_policy_ext_dep] libds_deps = [ecore_dep] libds_include_dirs = include_directories( -- 2.7.4 From 0710cb440ac93e4d3d702f552587fe7d650fd1d9 Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Wed, 2 Sep 2020 21:39:48 +0900 Subject: [PATCH 09/16] test/meson.build: enable DSWaylandTizenPolicyExt test Change-Id: Iefb18de69c8b3d0293eb9f0f93d30357cc0aa77c Signed-off-by: Junseok, Kim --- tests/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/meson.build b/tests/meson.build index 372bf7e..16386aa 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -59,6 +59,7 @@ libds_tests_srcs = [ 'DSTizenAppinfo-test.cpp', 'DSWaylandProtocolTrace-test.cpp', 'DSTraceInfo-test.cpp', + 'DSWaylandTizenPolicyExt-test.cpp', ] gmock_dep = dependency('gmock', method : 'pkg-config') -- 2.7.4 From 2ea95ab58d70e6bd539749dea7b6930f85ed4b21 Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Thu, 3 Sep 2020 11:14:45 +0900 Subject: [PATCH 10/16] DSWindow: add TCs Change-Id: I15d8b6af8bce600fea21da5e50687129eccfab9f --- tests/DSWindow-test.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/DSWindow-test.cpp b/tests/DSWindow-test.cpp index d0f7695..0cb0eaf 100644 --- a/tests/DSWindow-test.cpp +++ b/tests/DSWindow-test.cpp @@ -194,3 +194,17 @@ TEST_F(DSWindowTest, UserGeometryTest) EXPECT_TRUE(win->isAllowUserGeometry()); } +TEST_F(DSWindowTest, TypeTest) +{ + auto win = std::make_shared(); + EXPECT_TRUE(win != nullptr); + + int type; + type = win->getType(); + EXPECT_TRUE(type == 0); + + win->setType(3); + + type = win->getType(); + EXPECT_TRUE(type == 3); +} -- 2.7.4 From 3d6f0ede9900b8a441cd7055888f045d7ab1fb0c Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Thu, 3 Sep 2020 11:15:34 +0900 Subject: [PATCH 11/16] DSWindowShell: add TCs Change-Id: Ic3bd18612635228e73b47cab600cb58d11c06244 --- tests/DSWindowShell-test.cpp | 71 +++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 43 deletions(-) diff --git a/tests/DSWindowShell-test.cpp b/tests/DSWindowShell-test.cpp index bb5b3a7..0eae594 100644 --- a/tests/DSWindowShell-test.cpp +++ b/tests/DSWindowShell-test.cpp @@ -379,7 +379,7 @@ TEST_F(DSWindowShellTest, unsetFocus) EXPECT_TRUE(winShell->setFocus() == true); EXPECT_TRUE(winShell->isFocused() == true); EXPECT_TRUE(winShell->unsetFocus() == true); - EXPECT_TRUE(winShell->isFocused() != true); + EXPECT_TRUE(winShell->isFocused() == false); } TEST_F(DSWindowShellTest, activate_P1) @@ -405,7 +405,7 @@ TEST_F(DSWindowShellTest, isActivated_P1) std::unique_ptr winShell = std::make_unique(window.get()); EXPECT_TRUE(winShell != nullptr); - // do something + EXPECT_TRUE(winShell->isActivated()); } TEST_F(DSWindowShellTest, iconify_P1) @@ -414,7 +414,8 @@ TEST_F(DSWindowShellTest, iconify_P1) std::unique_ptr winShell = std::make_unique(window.get()); EXPECT_TRUE(winShell != nullptr); - // do something + bool ret = winShell->iconify(); + EXPECT_TRUE(ret == true); } TEST_F(DSWindowShellTest, iconify_P2) @@ -423,7 +424,8 @@ TEST_F(DSWindowShellTest, iconify_P2) std::unique_ptr winShell = std::make_unique(window.get()); EXPECT_TRUE(winShell != nullptr); - // do something + bool ret = winShell->iconify(true); + EXPECT_TRUE(ret == true); } TEST_F(DSWindowShellTest, uniconify_P1) @@ -432,7 +434,8 @@ TEST_F(DSWindowShellTest, uniconify_P1) std::unique_ptr winShell = std::make_unique(window.get()); EXPECT_TRUE(winShell != nullptr); - // do something + bool ret = winShell->uniconify(); + EXPECT_TRUE(ret == true); } TEST_F(DSWindowShellTest, uniconify_P2) @@ -441,7 +444,8 @@ TEST_F(DSWindowShellTest, uniconify_P2) std::unique_ptr winShell = std::make_unique(window.get()); EXPECT_TRUE(winShell != nullptr); - // do something + bool ret = winShell->uniconify(true); + EXPECT_TRUE(ret == true); } TEST_F(DSWindowShellTest, getIconicState_P1) @@ -450,7 +454,8 @@ TEST_F(DSWindowShellTest, getIconicState_P1) std::unique_ptr winShell = std::make_unique(window.get()); EXPECT_TRUE(winShell != nullptr); - // do something + int state = winShell->getIconicState(); + EXPECT_TRUE(state == 0); } TEST_F(DSWindowShellTest, setType_P1) @@ -459,16 +464,11 @@ TEST_F(DSWindowShellTest, setType_P1) std::unique_ptr winShell = std::make_unique(window.get()); EXPECT_TRUE(winShell != nullptr); - // do something -} - -TEST_F(DSWindowShellTest, getType_P1) -{ - auto window = std::make_shared(); - std::unique_ptr winShell = std::make_unique(window.get()); - EXPECT_TRUE(winShell != nullptr); + bool ret = winShell->setType(1); + EXPECT_TRUE(ret == true); - // do something + int type = winShell->getType(); + EXPECT_TRUE(type == 1); } TEST_F(DSWindowShellTest, maximize_P1) @@ -477,16 +477,11 @@ TEST_F(DSWindowShellTest, maximize_P1) std::unique_ptr winShell = std::make_unique(window.get()); EXPECT_TRUE(winShell != nullptr); - // do something -} - -TEST_F(DSWindowShellTest, isMaximized_P1) -{ - auto window = std::make_shared(); - std::unique_ptr winShell = std::make_unique(window.get()); - EXPECT_TRUE(winShell != nullptr); + bool ret = winShell->maximize(); + EXPECT_TRUE(ret == true); - // do something + bool maximized = winShell->isMaximized(); + EXPECT_TRUE(maximized == true); } TEST_F(DSWindowShellTest, fullscreen_P1) @@ -495,16 +490,11 @@ TEST_F(DSWindowShellTest, fullscreen_P1) std::unique_ptr winShell = std::make_unique(window.get()); EXPECT_TRUE(winShell != nullptr); - // do something -} - -TEST_F(DSWindowShellTest, isFullscreen_P1) -{ - auto window = std::make_shared(); - std::unique_ptr winShell = std::make_unique(window.get()); - EXPECT_TRUE(winShell != nullptr); + bool ret = winShell->fullscreen(); + EXPECT_TRUE(ret == true); - // do something + bool fullscreen = winShell->isFullscreen(); + EXPECT_TRUE(fullscreen == true); } TEST_F(DSWindowShellTest, setRole_P1) @@ -513,16 +503,11 @@ TEST_F(DSWindowShellTest, setRole_P1) std::unique_ptr winShell = std::make_unique(window.get()); EXPECT_TRUE(winShell != nullptr); - // do something -} - -TEST_F(DSWindowShellTest, getRole_P1) -{ - auto window = std::make_shared(); - std::unique_ptr winShell = std::make_unique(window.get()); - EXPECT_TRUE(winShell != nullptr); + const char *role = winShell->getRole(); + EXPECT_TRUE(role == nullptr); - // do something + bool ret = winShell->setRole("quickpanel"); + EXPECT_TRUE(ret == true); } TEST_F(DSWindowShellTest, vkbdFloating_P1) -- 2.7.4 From e72915c63895cd7015a7a4612b7beae4b8de8334 Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Thu, 3 Sep 2020 12:39:31 +0900 Subject: [PATCH 12/16] DSWaylandServer: define LCOV_EXCL block(s) for wayland basic classes Change-Id: I4c8bd966c9300385407888ffb6eea562e88ce3bc Signed-off-by: Sung-Jin Park --- src/DSWaylandServer/dswayland-server-eom.cpp | 2 ++ src/DSWaylandServer/dswayland-server-eom.h | 2 ++ src/DSWaylandServer/dswayland-server-fullscreen-shell.cpp | 2 ++ src/DSWaylandServer/dswayland-server-fullscreen-shell.h | 2 ++ src/DSWaylandServer/dswayland-server-input-method.cpp | 2 ++ src/DSWaylandServer/dswayland-server-input-method.h | 2 ++ src/DSWaylandServer/dswayland-server-presentation-time.cpp | 2 ++ src/DSWaylandServer/dswayland-server-presentation-time.h | 2 ++ src/DSWaylandServer/dswayland-server-scaler.cpp | 2 ++ src/DSWaylandServer/dswayland-server-scaler.h | 2 ++ src/DSWaylandServer/dswayland-server-screenshooter.cpp | 2 ++ src/DSWaylandServer/dswayland-server-screenshooter.h | 2 ++ src/DSWaylandServer/dswayland-server-text-cursor-position.cpp | 2 ++ src/DSWaylandServer/dswayland-server-text-cursor-position.h | 2 ++ src/DSWaylandServer/dswayland-server-text.cpp | 2 ++ src/DSWaylandServer/dswayland-server-text.h | 2 ++ src/DSWaylandServer/dswayland-server-tizen-dpms.cpp | 2 ++ src/DSWaylandServer/dswayland-server-tizen-dpms.h | 2 ++ src/DSWaylandServer/dswayland-server-tizen-extension.cpp | 2 ++ src/DSWaylandServer/dswayland-server-tizen-extension.h | 2 ++ src/DSWaylandServer/dswayland-server-tizen-hwc.cpp | 2 ++ src/DSWaylandServer/dswayland-server-tizen-hwc.h | 2 ++ src/DSWaylandServer/dswayland-server-tizen-launch.cpp | 2 ++ src/DSWaylandServer/dswayland-server-tizen-launch.h | 2 ++ src/DSWaylandServer/dswayland-server-tizen-policy-ext.cpp | 2 ++ src/DSWaylandServer/dswayland-server-tizen-policy-ext.h | 2 ++ src/DSWaylandServer/dswayland-server-tizen-remote-surface.cpp | 2 ++ src/DSWaylandServer/dswayland-server-tizen-remote-surface.h | 2 ++ src/DSWaylandServer/dswayland-server-tizen-surface.cpp | 2 ++ src/DSWaylandServer/dswayland-server-tizen-surface.h | 2 ++ src/DSWaylandServer/dswayland-server-transform.cpp | 2 ++ src/DSWaylandServer/dswayland-server-transform.h | 2 ++ src/DSWaylandServer/dswayland-server-tzsh.cpp | 2 ++ src/DSWaylandServer/dswayland-server-tzsh.h | 2 ++ src/DSWaylandServer/dswayland-server-wayland.cpp | 2 ++ src/DSWaylandServer/dswayland-server-wayland.h | 2 ++ src/DSWaylandServer/dswayland-server-xdg-shell-unstable-v6.cpp | 2 ++ src/DSWaylandServer/dswayland-server-xdg-shell-unstable-v6.h | 2 ++ src/DSWaylandServer/dswayland-server-xdg-shell.cpp | 2 ++ src/DSWaylandServer/dswayland-server-xdg-shell.h | 2 ++ 40 files changed, 80 insertions(+) diff --git a/src/DSWaylandServer/dswayland-server-eom.cpp b/src/DSWaylandServer/dswayland-server-eom.cpp index a6ff4a1..c1805da 100644 --- a/src/DSWaylandServer/dswayland-server-eom.cpp +++ b/src/DSWaylandServer/dswayland-server-eom.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/eom.xml */ #include "dswayland-server-wl-eom.h" @@ -435,3 +436,4 @@ namespace DSWaylandServer { } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-eom.h b/src/DSWaylandServer/dswayland-server-eom.h index 4630191..7c3edb3 100644 --- a/src/DSWaylandServer/dswayland-server-eom.h +++ b/src/DSWaylandServer/dswayland-server-eom.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/eom.xml */ #ifndef __DS_WL_EOM_PROTOCOL_H__ @@ -186,3 +187,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-fullscreen-shell.cpp b/src/DSWaylandServer/dswayland-server-fullscreen-shell.cpp index 1062e0d..e728f47 100644 --- a/src/DSWaylandServer/dswayland-server-fullscreen-shell.cpp +++ b/src/DSWaylandServer/dswayland-server-fullscreen-shell.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/fullscreen-shell.xml */ #include "dswayland-server-fullscreen-shell.h" @@ -470,3 +471,4 @@ namespace DSWaylandServer { } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-fullscreen-shell.h b/src/DSWaylandServer/dswayland-server-fullscreen-shell.h index 97ab3a6..4e59050 100644 --- a/src/DSWaylandServer/dswayland-server-fullscreen-shell.h +++ b/src/DSWaylandServer/dswayland-server-fullscreen-shell.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/fullscreen-shell.xml */ #ifndef __DS_FULLSCREEN_SHELL_PROTOCOL_H__ @@ -218,3 +219,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-input-method.cpp b/src/DSWaylandServer/dswayland-server-input-method.cpp index 68351db..34fb3e6 100644 --- a/src/DSWaylandServer/dswayland-server-input-method.cpp +++ b/src/DSWaylandServer/dswayland-server-input-method.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/input-method.xml */ #include "dswayland-server-input-method.h" @@ -1788,3 +1789,4 @@ namespace DSWaylandServer { } } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-input-method.h b/src/DSWaylandServer/dswayland-server-input-method.h index 1f800ec..56c6844 100644 --- a/src/DSWaylandServer/dswayland-server-input-method.h +++ b/src/DSWaylandServer/dswayland-server-input-method.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/input-method.xml */ #ifndef __DS_INPUT_METHOD_PROTOCOL_H__ @@ -584,3 +585,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-presentation-time.cpp b/src/DSWaylandServer/dswayland-server-presentation-time.cpp index 1f75f74..75af141 100644 --- a/src/DSWaylandServer/dswayland-server-presentation-time.cpp +++ b/src/DSWaylandServer/dswayland-server-presentation-time.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/presentation-time.xml */ #include "dswayland-server-presentation-time.h" @@ -461,3 +462,4 @@ namespace DSWaylandServer { } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-presentation-time.h b/src/DSWaylandServer/dswayland-server-presentation-time.h index f3d3637..d377ffd 100644 --- a/src/DSWaylandServer/dswayland-server-presentation-time.h +++ b/src/DSWaylandServer/dswayland-server-presentation-time.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/presentation-time.xml */ #ifndef __DS_PRESENTATION_TIME_PROTOCOL_H__ @@ -204,3 +205,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-scaler.cpp b/src/DSWaylandServer/dswayland-server-scaler.cpp index a323847..12e10d0 100644 --- a/src/DSWaylandServer/dswayland-server-scaler.cpp +++ b/src/DSWaylandServer/dswayland-server-scaler.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/scaler.xml */ #include "dswayland-server-scaler.h" @@ -459,3 +460,4 @@ namespace DSWaylandServer { } } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-scaler.h b/src/DSWaylandServer/dswayland-server-scaler.h index 230fb71..dd197a3 100644 --- a/src/DSWaylandServer/dswayland-server-scaler.h +++ b/src/DSWaylandServer/dswayland-server-scaler.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/scaler.xml */ #ifndef __DS_SCALER_PROTOCOL_H__ @@ -222,3 +223,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-screenshooter.cpp b/src/DSWaylandServer/dswayland-server-screenshooter.cpp index 52c432f..75c0457 100644 --- a/src/DSWaylandServer/dswayland-server-screenshooter.cpp +++ b/src/DSWaylandServer/dswayland-server-screenshooter.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/screenshooter.xml */ #include "dswayland-server-screenshooter.h" @@ -221,3 +222,4 @@ namespace DSWaylandServer { } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-screenshooter.h b/src/DSWaylandServer/dswayland-server-screenshooter.h index fc55245..fb66535 100644 --- a/src/DSWaylandServer/dswayland-server-screenshooter.h +++ b/src/DSWaylandServer/dswayland-server-screenshooter.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/screenshooter.xml */ #ifndef __DS_SCREENSHOOTER_PROTOCOL_H__ @@ -108,3 +109,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-text-cursor-position.cpp b/src/DSWaylandServer/dswayland-server-text-cursor-position.cpp index ff63823..82ac43a 100644 --- a/src/DSWaylandServer/dswayland-server-text-cursor-position.cpp +++ b/src/DSWaylandServer/dswayland-server-text-cursor-position.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/text-cursor-position.xml */ #include "dswayland-server-text-cursor-position.h" @@ -205,3 +206,4 @@ namespace DSWaylandServer { } } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-text-cursor-position.h b/src/DSWaylandServer/dswayland-server-text-cursor-position.h index 736ec03..c148170 100644 --- a/src/DSWaylandServer/dswayland-server-text-cursor-position.h +++ b/src/DSWaylandServer/dswayland-server-text-cursor-position.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/text-cursor-position.xml */ #ifndef __DS_TEXT_CURSOR_POSITION_PROTOCOL_H__ @@ -106,3 +107,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-text.cpp b/src/DSWaylandServer/dswayland-server-text.cpp index e4bed15..30cc051 100644 --- a/src/DSWaylandServer/dswayland-server-text.cpp +++ b/src/DSWaylandServer/dswayland-server-text.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/text.xml */ #include "dswayland-server-text.h" @@ -1376,3 +1377,4 @@ namespace DSWaylandServer { } } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-text.h b/src/DSWaylandServer/dswayland-server-text.h index 622f5d6..8f91aeb 100644 --- a/src/DSWaylandServer/dswayland-server-text.h +++ b/src/DSWaylandServer/dswayland-server-text.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/text.xml */ #ifndef __DS_TEXT_PROTOCOL_H__ @@ -471,3 +472,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tizen-dpms.cpp b/src/DSWaylandServer/dswayland-server-tizen-dpms.cpp index d3e7cda..b9ff7e0 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-dpms.cpp +++ b/src/DSWaylandServer/dswayland-server-tizen-dpms.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/tizen-dpms.xml */ #include "dswayland-server-tizen-dpms.h" @@ -279,3 +280,4 @@ namespace DSWaylandServer { } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tizen-dpms.h b/src/DSWaylandServer/dswayland-server-tizen-dpms.h index 4d73523..04894c6 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-dpms.h +++ b/src/DSWaylandServer/dswayland-server-tizen-dpms.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/tizen-dpms.xml */ #ifndef __DS_TIZEN_DPMS_PROTOCOL_H__ @@ -134,3 +135,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tizen-extension.cpp b/src/DSWaylandServer/dswayland-server-tizen-extension.cpp index 1fe2703..66269f9 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-extension.cpp +++ b/src/DSWaylandServer/dswayland-server-tizen-extension.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/tizen-extension.xml */ #include "dswayland-server-tizen-extension.h" @@ -7861,3 +7862,4 @@ namespace DSWaylandServer { } /*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tizen-extension.h b/src/DSWaylandServer/dswayland-server-tizen-extension.h index b4b0900..509acfc 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-extension.h +++ b/src/DSWaylandServer/dswayland-server-tizen-extension.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/tizen-extension.xml */ #ifndef __DS_TIZEN_EXTENSION_PROTOCOL_H__ @@ -3150,3 +3151,4 @@ namespace DSWaylandServer { /*LCOV_EXCL_STOP*/ #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tizen-hwc.cpp b/src/DSWaylandServer/dswayland-server-tizen-hwc.cpp index c4f0df1..67b13b6 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-hwc.cpp +++ b/src/DSWaylandServer/dswayland-server-tizen-hwc.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/tizen-hwc.xml */ #include "dswayland-server-tizen-hwc.h" @@ -413,3 +414,4 @@ namespace DSWaylandServer { } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tizen-hwc.h b/src/DSWaylandServer/dswayland-server-tizen-hwc.h index 9344392..c763bac 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-hwc.h +++ b/src/DSWaylandServer/dswayland-server-tizen-hwc.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/tizen-hwc.xml */ #ifndef __DS_TIZEN_HWC_PROTOCOL_H__ @@ -188,3 +189,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tizen-launch.cpp b/src/DSWaylandServer/dswayland-server-tizen-launch.cpp index f84892d..2f12f98 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-launch.cpp +++ b/src/DSWaylandServer/dswayland-server-tizen-launch.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/tizen-launch.xml */ #include "dswayland-server-tizen-launch.h" @@ -845,3 +846,4 @@ namespace DSWaylandServer { } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tizen-launch.h b/src/DSWaylandServer/dswayland-server-tizen-launch.h index fa93b85..53b4f51 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-launch.h +++ b/src/DSWaylandServer/dswayland-server-tizen-launch.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/tizen-launch.xml */ #ifndef __DS_TIZEN_LAUNCH_PROTOCOL_H__ @@ -375,3 +376,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tizen-policy-ext.cpp b/src/DSWaylandServer/dswayland-server-tizen-policy-ext.cpp index 590d2d7..47b68dd 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-policy-ext.cpp +++ b/src/DSWaylandServer/dswayland-server-tizen-policy-ext.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/tizen-policy-ext.xml */ #include "dswayland-server-tizen-policy-ext.h" @@ -576,3 +577,4 @@ namespace DSWaylandServer { } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tizen-policy-ext.h b/src/DSWaylandServer/dswayland-server-tizen-policy-ext.h index e1ee610..dee296d 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-policy-ext.h +++ b/src/DSWaylandServer/dswayland-server-tizen-policy-ext.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/tizen-policy-ext.xml */ #ifndef __DS_TIZEN_POLICY_EXT_PROTOCOL_H__ @@ -235,3 +236,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tizen-remote-surface.cpp b/src/DSWaylandServer/dswayland-server-tizen-remote-surface.cpp index 2f0512d..de98bdb 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-remote-surface.cpp +++ b/src/DSWaylandServer/dswayland-server-tizen-remote-surface.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/tizen-remote-surface.xml */ #include "dswayland-server-tizen-remote-surface.h" @@ -1286,3 +1287,4 @@ namespace DSWaylandServer { } } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tizen-remote-surface.h b/src/DSWaylandServer/dswayland-server-tizen-remote-surface.h index de250ee..85216c2 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-remote-surface.h +++ b/src/DSWaylandServer/dswayland-server-tizen-remote-surface.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/tizen-remote-surface.xml */ #ifndef __DS_TIZEN_REMOTE_SURFACE_PROTOCOL_H__ @@ -575,3 +576,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tizen-surface.cpp b/src/DSWaylandServer/dswayland-server-tizen-surface.cpp index d721fba..d902887 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-surface.cpp +++ b/src/DSWaylandServer/dswayland-server-tizen-surface.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/tizen-surface.xml */ #include "dswayland-server-tizen-surface.h" @@ -426,3 +427,4 @@ namespace DSWaylandServer { } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tizen-surface.h b/src/DSWaylandServer/dswayland-server-tizen-surface.h index 96a5632..a1bc627 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-surface.h +++ b/src/DSWaylandServer/dswayland-server-tizen-surface.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/tizen-surface.xml */ #ifndef __DS_TIZEN_SURFACE_PROTOCOL_H__ @@ -195,3 +196,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-transform.cpp b/src/DSWaylandServer/dswayland-server-transform.cpp index 3cfa511..0964ba6 100644 --- a/src/DSWaylandServer/dswayland-server-transform.cpp +++ b/src/DSWaylandServer/dswayland-server-transform.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/transform.xml */ #include "dswayland-server-transform.h" @@ -420,3 +421,4 @@ namespace DSWaylandServer { } } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-transform.h b/src/DSWaylandServer/dswayland-server-transform.h index 52ce46c..3996463 100644 --- a/src/DSWaylandServer/dswayland-server-transform.h +++ b/src/DSWaylandServer/dswayland-server-transform.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/transform.xml */ #ifndef __DS_TRANSFORM_PROTOCOL_H__ @@ -202,3 +203,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tzsh.cpp b/src/DSWaylandServer/dswayland-server-tzsh.cpp index ba422df..ae8c2a1 100644 --- a/src/DSWaylandServer/dswayland-server-tzsh.cpp +++ b/src/DSWaylandServer/dswayland-server-tzsh.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/tzsh.xml */ #include "dswayland-server-tizen-ws-shell.h" @@ -4061,3 +4062,4 @@ namespace DSWaylandServer { } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tzsh.h b/src/DSWaylandServer/dswayland-server-tzsh.h index 4e58000..3b94e6c 100644 --- a/src/DSWaylandServer/dswayland-server-tzsh.h +++ b/src/DSWaylandServer/dswayland-server-tzsh.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/tzsh.xml */ #ifndef __DS_TIZEN_WS_SHELL_PROTOCOL_H__ @@ -1774,3 +1775,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-wayland.cpp b/src/DSWaylandServer/dswayland-server-wayland.cpp index d9a1fe8..59baf05 100644 --- a/src/DSWaylandServer/dswayland-server-wayland.cpp +++ b/src/DSWaylandServer/dswayland-server-wayland.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland/wayland.xml */ #include "dswayland-server-wayland.h" @@ -5374,3 +5375,4 @@ namespace DSWaylandServer { } } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-wayland.h b/src/DSWaylandServer/dswayland-server-wayland.h index 85dcffb..0cdfa52 100644 --- a/src/DSWaylandServer/dswayland-server-wayland.h +++ b/src/DSWaylandServer/dswayland-server-wayland.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland/wayland.xml */ #ifndef __DS_WAYLAND_PROTOCOL_H__ @@ -2242,3 +2243,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-xdg-shell-unstable-v6.cpp b/src/DSWaylandServer/dswayland-server-xdg-shell-unstable-v6.cpp index 63d8e1e..eba1832 100644 --- a/src/DSWaylandServer/dswayland-server-xdg-shell-unstable-v6.cpp +++ b/src/DSWaylandServer/dswayland-server-xdg-shell-unstable-v6.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/xdg-shell-unstable-v6.xml */ #include "dswayland-server-xdg-shell-unstable-v6.h" @@ -1504,3 +1505,4 @@ namespace DSWaylandServer { } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-xdg-shell-unstable-v6.h b/src/DSWaylandServer/dswayland-server-xdg-shell-unstable-v6.h index e6784a6..3de2c92 100644 --- a/src/DSWaylandServer/dswayland-server-xdg-shell-unstable-v6.h +++ b/src/DSWaylandServer/dswayland-server-xdg-shell-unstable-v6.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/xdg-shell-unstable-v6.xml */ #ifndef __DS_XDG_SHELL_UNSTABLE_V6_PROTOCOL_H__ @@ -662,3 +663,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-xdg-shell.cpp b/src/DSWaylandServer/dswayland-server-xdg-shell.cpp index 0cb664b..54a147d 100644 --- a/src/DSWaylandServer/dswayland-server-xdg-shell.cpp +++ b/src/DSWaylandServer/dswayland-server-xdg-shell.cpp @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/xdg-shell.xml */ #include "dswayland-server-xdg-shell.h" @@ -1504,3 +1505,4 @@ namespace DSWaylandServer { } +/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-xdg-shell.h b/src/DSWaylandServer/dswayland-server-xdg-shell.h index 4a90969..68073fe 100644 --- a/src/DSWaylandServer/dswayland-server-xdg-shell.h +++ b/src/DSWaylandServer/dswayland-server-xdg-shell.h @@ -1,3 +1,4 @@ +/*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/xdg-shell.xml */ #ifndef __DS_XDG_SHELL_PROTOCOL_H__ @@ -674,3 +675,4 @@ namespace DSWaylandServer { } #endif +/*LCOV_EXCL_STOP*/ -- 2.7.4 From df3e7cc51f9c073c1d1f151c533dd9e8a8703dff Mon Sep 17 00:00:00 2001 From: Duna Oh Date: Thu, 3 Sep 2020 11:04:32 +0900 Subject: [PATCH 13/16] DSEventLoop: add testEmitIdleEntererFuncs() for test cases Change-Id: I70d59b678e53d1bc3f696001a37a57f5f82637d8 --- src/DSEventLoop/DSEventLoop.cpp | 8 ++++++++ src/DSEventLoop/DSEventLoop.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/DSEventLoop/DSEventLoop.cpp b/src/DSEventLoop/DSEventLoop.cpp index 26fdf07..f79af6d 100644 --- a/src/DSEventLoop/DSEventLoop.cpp +++ b/src/DSEventLoop/DSEventLoop.cpp @@ -126,4 +126,12 @@ Eina_Bool DSEventLoop::__emitIdleEntererFuncs(void *data) return EINA_TRUE; } +// for test cases only +Eina_Bool DSEventLoop::testEmitIdleEntererFuncs(void *data) +{ + __idleEntererSignal.emit(data); + + return EINA_TRUE; +} + } // namespace display_server diff --git a/src/DSEventLoop/DSEventLoop.h b/src/DSEventLoop/DSEventLoop.h index c2ea27d..1cc365b 100644 --- a/src/DSEventLoop/DSEventLoop.h +++ b/src/DSEventLoop/DSEventLoop.h @@ -47,6 +47,8 @@ public: // register callback functions void registerCallbackIdleEnterer(DSObject *slot, std::function func); + static Eina_Bool testEmitIdleEntererFuncs(void *data); // for test cases only + private: DSEventLoop(); // private constructor ~DSEventLoop(); // private desctructor -- 2.7.4 From d77b08274443beee0f2ab1dcc5bf094defcb933b Mon Sep 17 00:00:00 2001 From: Duna Oh Date: Thu, 3 Sep 2020 11:05:11 +0900 Subject: [PATCH 14/16] DSZone: add testDestroyWindow() for test cases Change-Id: I870cd47f2544f8ff0813b8b1a77bd78acc175e19 --- src/DSZone/DSZone.cpp | 9 +++++++++ src/DSZone/DSZone.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/DSZone/DSZone.cpp b/src/DSZone/DSZone.cpp index eedc406..3997032 100644 --- a/src/DSZone/DSZone.cpp +++ b/src/DSZone/DSZone.cpp @@ -242,6 +242,15 @@ bool DSZone::testCreateWindow(std::shared_ptr waylandSurface) return true; } +bool DSZone::testDestroyWindow(std::shared_ptr waylandSurface) +{ + if (waylandSurface == nullptr) + return false; + + __onSurfaceDestroy(waylandSurface); + return true; +} + std::list> DSZone::getWindowList() { return __windowList; diff --git a/src/DSZone/DSZone.h b/src/DSZone/DSZone.h index 0fdd351..3857d70 100644 --- a/src/DSZone/DSZone.h +++ b/src/DSZone/DSZone.h @@ -62,6 +62,7 @@ public: void callCallbackWindowShellCreated(std::shared_ptr winShell); // for test bool testCreateWindow(std::shared_ptr waylandSurface); + bool testDestroyWindow(std::shared_ptr waylandSurface); // for window property bool setWindowParent(DSWaylandSurface *dswlSurface, DSWaylandSurface *dswlParentSurface); -- 2.7.4 From e3b8c15b07772269aa82ee4583705d6eadd6c725 Mon Sep 17 00:00:00 2001 From: Duna Oh Date: Thu, 3 Sep 2020 11:06:25 +0900 Subject: [PATCH 15/16] DSTraceIno-test: add more test cases for better code coverage Change-Id: I0c70687ec6b70f4f082073c31160a107755e1c57 --- src/DSTraceInfo/DSTraceInfo.cpp | 43 ++++++++++++++++++++++------------- src/DSTraceInfo/DSTraceInfo.h | 2 ++ tests/DSTraceInfo-test.cpp | 50 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 79 insertions(+), 16 deletions(-) diff --git a/src/DSTraceInfo/DSTraceInfo.cpp b/src/DSTraceInfo/DSTraceInfo.cpp index 608c562..a5c357c 100644 --- a/src/DSTraceInfo/DSTraceInfo.cpp +++ b/src/DSTraceInfo/DSTraceInfo.cpp @@ -50,18 +50,17 @@ bool DSTraceInfo::attachPolicyArea(std::shared_ptr policyArea) DSPolicyAreaPrivate *policyAreaPriv = DSPolicyAreaPrivate::getPrivate(__policyArea.get()); __zone = policyAreaPriv->getZone(); - if (__zone == nullptr) { - DSLOG_ERR("DSTraceInfo", "No zone attached to this policyArea(%p)", policyArea); - return false; - } - - __zone->registerCallbackWindowCreated(this, std::bind(&DSTraceInfo::__onWindowCreated, this, std::placeholders::_1)); - __zone->registerCallbackWindowStackChanged(this, std::bind(&DSTraceInfo::__onWindowStackChanged, this, std::placeholders::_1)); - __zone->registerCallbackWindowDestroy(this, std::bind(&DSTraceInfo::__onWindowDestroy, this, std::placeholders::_1)); + if (__zone) { + __zone->registerCallbackWindowCreated(this, std::bind(&DSTraceInfo::__onWindowCreated, this, std::placeholders::_1)); + __zone->registerCallbackWindowStackChanged(this, std::bind(&DSTraceInfo::__onWindowStackChanged, this, std::placeholders::_1)); + __zone->registerCallbackWindowDestroy(this, std::bind(&DSTraceInfo::__onWindowDestroy, this, std::placeholders::_1)); - __windowList = __zone->getWindowList(); + __windowList = __zone->getWindowList(); + return true; + } - return true; + DSLOG_ERR("DSTraceInfo", "No zone attached to this policyArea(%p)", policyArea); + return false; } void DSTraceInfo::__onEventIdleEnterer(void *data) @@ -75,16 +74,25 @@ void DSTraceInfo::__onEventIdleEnterer(void *data) void DSTraceInfo::printWindowsInfo() { + stPosition pos{0,0}; + stSize sz{0,0}; + DSWaylandSurface *dwlSurface{nullptr}; + DSWaylandClient *dwClient{nullptr}; + pid_t pid = -1; + DSLOG_INF("DSTraceInfo", "--------------Top level windows: %d--------------", __windowList.size()); DSLOG_INF("DSTraceInfo", " No Win_ID PID w h x y (S)kipFoc has(F)ocus (U)serGeom (V)kbdFloating Parent Title"); for (std::shared_ptr w : __windowList) { - stPosition pos = w->getPosition(); - stSize sz = w->getSize(); - DSWaylandSurface *dwlSurface = w->surface(); - DSWaylandClient *dwClient = dwlSurface->getClient(); - pid_t pid = dwClient->pid(); + pos = w->getPosition(); + sz = w->getSize(); + dwlSurface = w->surface(); + if (dwlSurface) { + dwClient = dwlSurface->getClient(); + if (dwClient) pid = dwClient->pid(); + } + DSLOG_INF("DSTraceInfo", " %d: %p %d %4d %4d %4d %4d %c %c %c %c %p %s", w->getZOrder(), w.get(), pid, \ sz.w, sz.h, pos.x, pos.y, w->getSkipFocus()?'S':' ', w->hasFocus()?'F':' ', w->isAllowUserGeometry()?'U':' ', w->getVkbdFloating()?'V':' ', \ w->getParent(), (w->getTitle().compare("") == 0)?"No Title":w->getTitle().c_str()); @@ -115,4 +123,9 @@ void DSTraceInfo::__onWindowDestroy(std::shared_ptr window) __windowUpdated = true; } +std::shared_ptr DSTraceInfo::getZone() +{ + return __zone; +} + } \ No newline at end of file diff --git a/src/DSTraceInfo/DSTraceInfo.h b/src/DSTraceInfo/DSTraceInfo.h index 35a6516..1f6d83c 100644 --- a/src/DSTraceInfo/DSTraceInfo.h +++ b/src/DSTraceInfo/DSTraceInfo.h @@ -39,8 +39,10 @@ class DSTraceInfo : public DSObject public: explicit DSTraceInfo(); virtual ~DSTraceInfo(); + bool attachPolicyArea(std::shared_ptr policyArea); void printWindowsInfo(); + std::shared_ptr getZone(); private: void __onWindowCreated(std::shared_ptr window); diff --git a/tests/DSTraceInfo-test.cpp b/tests/DSTraceInfo-test.cpp index 5d99ebb..367a7f7 100644 --- a/tests/DSTraceInfo-test.cpp +++ b/tests/DSTraceInfo-test.cpp @@ -31,13 +31,36 @@ class DSTraceInfoTest : public ::testing::Test public: void SetUp(void) override { + Ecore_Timer *timer = nullptr; + + DSWaylandCompositor::getInstance(); + eventLoop = DSEventLoop::getInstance(); + double delayInSecond = 0.5; + auto timerCb = [](void *data) -> Eina_Bool { + DSEventLoop *loop = (DSEventLoop *)data; + EXPECT_TRUE(loop->quit() == true); + return EINA_FALSE; + }; + + timer = ecore_timer_loop_add(delayInSecond, timerCb, eventLoop); + EXPECT_TRUE(timer != nullptr); + + eventLoop->run(); + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); setenv("XDG_RUNTIME_DIR", xdir, 1); } void TearDown(void) override { + eventLoop->quit(); + DSEventLoop::releaseInstance(); + DSWaylandCompositor::releaseInstance(); + unsetenv("XDG_RUNTIME_DIR"); } + DSEventLoop *eventLoop; +private: + }; TEST_F(DSTraceInfoTest, NewTraceInfo) @@ -57,10 +80,35 @@ TEST_F(DSTraceInfoTest, attachPolicyArea) TEST_F(DSTraceInfoTest, printWindowsInfo) { + std::shared_ptr zone(nullptr); + auto traceInfo = std::make_unique(); EXPECT_TRUE(traceInfo != nullptr); auto policyArea = std::make_shared(); EXPECT_TRUE(policyArea != nullptr); - traceInfo->printWindowsInfo(); + if (traceInfo->attachPolicyArea(policyArea)) + { + std::string title1{"TestWindow1"}; + std::string title2{"TestWindow2"}; + zone = traceInfo->getZone(); + + auto dswlSurface1 = std::make_shared(); + EXPECT_TRUE(zone->testCreateWindow(dswlSurface1)); + + auto dswlSurface2 = std::make_shared(); + EXPECT_TRUE(zone->testCreateWindow(dswlSurface2)); + + usleep(100000); + eventLoop->testEmitIdleEntererFuncs(nullptr); + + zone->raiseWindow(dswlSurface1.get()); + eventLoop->testEmitIdleEntererFuncs(nullptr); + + EXPECT_TRUE(zone->testDestroyWindow(dswlSurface1)); + eventLoop->testEmitIdleEntererFuncs(nullptr); + + EXPECT_TRUE(zone->testDestroyWindow(dswlSurface2)); + eventLoop->testEmitIdleEntererFuncs(nullptr); + } } -- 2.7.4 From dc7d399d7d1a2b098f5ce48b2ee4715f28a8334e Mon Sep 17 00:00:00 2001 From: Duna Oh Date: Thu, 3 Sep 2020 15:13:33 +0900 Subject: [PATCH 16/16] DSwaylandTizenAppinfo-test: add more test cases for better code coverage Change-Id: I776474f8eb2f06141b393b54397a942e7771547a --- src/DSWaylandServer/DSWaylandTizenAppinfo.cpp | 3 + tests/DSWaylandTizenAppinfo-test.cpp | 92 +++++++++++++++++++++++++++ tests/meson.build | 3 +- 3 files changed, 97 insertions(+), 1 deletion(-) diff --git a/src/DSWaylandServer/DSWaylandTizenAppinfo.cpp b/src/DSWaylandServer/DSWaylandTizenAppinfo.cpp index c78681d..852db56 100644 --- a/src/DSWaylandServer/DSWaylandTizenAppinfo.cpp +++ b/src/DSWaylandServer/DSWaylandTizenAppinfo.cpp @@ -63,6 +63,7 @@ void DSWaylandTizenAppinfoPrivate::tizen_launch_appinfo_destroy(Resource *resour { DSLOG_DBG("TizenAppinfoPriv", ""); } +/*LCOV_EXCL_START*/ void DSWaylandTizenAppinfoPrivate::tizen_launch_appinfo_register_pid(Resource *resource, uint32_t pid) { DSLOG_DBG("TizenAppinfoPriv", ""); @@ -75,6 +76,8 @@ void DSWaylandTizenAppinfoPrivate::tizen_launch_appinfo_set_appid(Resource *reso { DSLOG_DBG("TizenAppinfoPriv", ""); } +/*LCOV_EXCL_STOP*/ + void DSWaylandTizenAppinfoPrivate::tizen_launch_appinfo_get_base_output_resolution(Resource *resource, uint32_t pid) { DSLOG_DBG("TizenAppinfoPriv", ""); diff --git a/tests/DSWaylandTizenAppinfo-test.cpp b/tests/DSWaylandTizenAppinfo-test.cpp index 8589a32..b77fe57 100644 --- a/tests/DSWaylandTizenAppinfo-test.cpp +++ b/tests/DSWaylandTizenAppinfo-test.cpp @@ -22,7 +22,9 @@ */ #include "libds-tests.h" +#include #include "DSWaylandTizenAppinfo.h" +#include "DSTizenAppinfoMgr.h" using namespace display_server; @@ -52,6 +54,20 @@ TEST_F(DSWaylandTizenAppinfoTest, New_Appinfo) DSWaylandCompositor::releaseInstance(); } +TEST_F(DSWaylandTizenAppinfoTest, New_Appinfo_with_AppinfoMgr) +{ + DSWaylandCompositor *compositor = DSWaylandCompositor::getInstance(); + DSTizenAppinfoMgr *dsAppinfoMgr = DSTizenAppinfoMgr::getInstance(); + DSWaylandTizenAppinfo *tzAppinfo = new DSWaylandTizenAppinfo(compositor, dsAppinfoMgr); + EXPECT_TRUE(tzAppinfo != nullptr); + + if (tzAppinfo) + delete tzAppinfo; + + DSTizenAppinfoMgr::releaseInstance(); + DSWaylandCompositor::releaseInstance(); +} + TEST_F(DSWaylandTizenAppinfoTest, Initialize_Appinfo) { bool ret; @@ -67,3 +83,79 @@ TEST_F(DSWaylandTizenAppinfoTest, Initialize_Appinfo) DSWaylandCompositor::releaseInstance(); } + +static struct tizen_launch_appinfo *tz_appinfo = nullptr; + +static void +handle_global(void *data, struct wl_registry *registry, uint32_t name, + const char *interface, uint32_t version) +{ + struct TestClient *testClient = (struct TestClient *)data; + + if (strcmp(interface, "wl_compositor") == 0) { + testClient->compositor = (struct wl_compositor *)wl_registry_bind(registry, name, &wl_compositor_interface, 1); + if (!testClient->compositor) + DSLOG_ERR("TEST", "wl_registry_bind compositor fails."); + } + else if(strcmp(interface, "tizen_launch_appinfo") == 0) + { + const char * appId = "com.samsung.clocksetting"; + + tz_appinfo = (struct tizen_launch_appinfo *)wl_registry_bind(registry, name, &tizen_launch_appinfo_interface, 1); + + tizen_launch_appinfo_register_appid(tz_appinfo, appId); + tizen_launch_appinfo_set_pid(tz_appinfo, appId, 4077); + tizen_launch_appinfo_deregister_appid(tz_appinfo, appId); + } +} + +static void +handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) +{} + +static const struct wl_registry_listener registry_listener = { + handle_global, + handle_global_remove +}; +TEST_F(DSWaylandTizenAppinfoTest, testRequest_Appinfo) +{ + auto mockWaylandCompositor = std::make_unique(); + + Ecore_Timer *serverQuitTimer = nullptr; + double severQuitTime = 1.0; + auto serverQuitFunc = [](void *data) -> Eina_Bool { + MockWaylandCompositor *comp = (MockWaylandCompositor *)data; + + // quit server + comp->quit(); + // check the emitting the surfaceCreated + EXPECT_TRUE(tz_appinfo != nullptr); + + return EINA_FALSE; + }; + serverQuitTimer = ecore_timer_loop_add(severQuitTime, serverQuitFunc, mockWaylandCompositor.get()); + EXPECT_TRUE(serverQuitTimer != nullptr); + + // create the wayland client which creates the wl_surface. + std::future clientThread = std::async(std::launch::async, []() -> bool { + std::this_thread::sleep_for(std::chrono::milliseconds(40)); + auto testClient = std::make_shared(); + + testClient->display = wl_display_connect(NULL); + EXPECT_TRUE(testClient->display != nullptr); + + testClient->registry = wl_display_get_registry(testClient->display); + wl_registry_add_listener(testClient->registry, ®istry_listener, testClient.get()); + wl_display_dispatch(testClient->display); + wl_display_roundtrip(testClient->display); + EXPECT_TRUE(testClient->compositor != nullptr); + + wl_display_disconnect(testClient->display); + + return true; + } + ); + + mockWaylandCompositor->run(); + EXPECT_TRUE(clientThread.get()); // join(wait) and get the return value. +} diff --git a/tests/meson.build b/tests/meson.build index 16386aa..3331b77 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -66,11 +66,12 @@ gmock_dep = dependency('gmock', method : 'pkg-config') ecore_dep = dependency('ecore', method : 'pkg-config') wl_client_dep = dependency('wayland-client', method : 'pkg-config') wl_tbm_dep = dependency('wayland-tbm-client', method : 'pkg-config') +tizen_launch_client_dep = dependency('tizen-launch-client') executable( 'libds-tests', libds_tests_srcs, - dependencies : [libds_declared_dep, gmock_dep, ecore_dep, ecore_evas_dep, wl_client_dep, wl_tbm_dep], + dependencies : [libds_declared_dep, gmock_dep, ecore_dep, ecore_evas_dep, wl_client_dep, wl_tbm_dep, tizen_launch_client_dep], install_dir : libds_prefix_bindir, install : true ) -- 2.7.4