Test: add DSZone test 26/241626/1
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 14 Jul 2020 08:32:58 +0000 (17:32 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 09:53:56 +0000 (18:53 +0900)
Change-Id: I152ade8e35c38018b2c8de77b26394a51ca07296

tests/DSZone-test.cpp [new file with mode: 0644]
tests/meson.build

diff --git a/tests/DSZone-test.cpp b/tests/DSZone-test.cpp
new file mode 100644 (file)
index 0000000..0e813ce
--- /dev/null
@@ -0,0 +1,37 @@
+#include "libds-tests.h"
+#include "DSZone.h"
+#include "DSPolicyArea.h"
+#include "DSPolicyAreaPrivate.h"
+
+using namespace display_server;
+
+class DSZoneTest : public ::testing::Test
+{
+public:
+       void SetUp(void) override
+       {}
+       void TearDown(void) override
+       {}
+};
+
+TEST_F(DSZoneTest, NewDSZone)
+{
+       auto policyArea = std::make_shared<DSPolicyArea>();
+       auto zone = std::make_unique<DSZone>(policyArea);
+       EXPECT_TRUE(zone != nullptr);
+}
+
+TEST_F(DSZoneTest, BasicMethods)
+{
+       auto policyArea = std::make_shared<DSPolicyArea>();
+       EXPECT_TRUE(policyArea->setPosition(10, 10) == true);
+       EXPECT_TRUE(policyArea->setSize(100, 100) == true);
+
+       auto zone = std::make_unique<DSZone>(policyArea);
+       EXPECT_TRUE(zone != nullptr);
+
+       EXPECT_TRUE(zone->getX() == 10);
+       EXPECT_TRUE(zone->getY() == 10);
+       EXPECT_TRUE(zone->getWidth() == 100);
+       EXPECT_TRUE(zone->getHeight() == 100);
+}
index 7d437f8..fb20037 100644 (file)
@@ -36,6 +36,7 @@ libds_tests_srcs = [
        'DSWaylandPointer-test.cpp',
        'DSWaylandKeyboard-test.cpp',
        'DSWaylandTouch-test.cpp',
+       'DSZone-test.cpp'
        ]
 
 gmock_dep = dependency('gmock', method : 'pkg-config')