implement the skeleton methods of DSPolicyArea 38/241538/1
authorSooChan Lim <sc1.lim@samsung.com>
Thu, 18 Jun 2020 01:35:35 +0000 (10:35 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 09:44:55 +0000 (18:44 +0900)
At this time, the test case fails.

Change-Id: I843c7a5c0cf9fd5a5de7cfc41919af7902ce8e78

src/DSPolicyArea/DSPolicyArea.cpp
src/DSPolicyArea/DSPolicyArea.h
tests/DSPolicyArea-test.cpp

index 9ed13e4..d9d1241 100644 (file)
@@ -3,8 +3,29 @@
 namespace display_server
 {
 DSPolicyArea::DSPolicyArea()
+       : __x(0),
+         __y(0),
+         __width(0),
+         __height(0),
+         __seat(nullptr)
 {}
 
 DSPolicyArea::~DSPolicyArea()
 {}
+
+bool DSPolicyArea::setPosition(int x, int y)
+{
+       return false;
+}
+
+bool DSPolicyArea::setSize(int width, int height)
+{
+       return false;
+}
+
+bool DSPolicyArea::attachSeat(DSSeat *seat)
+{
+       return false;
+}
+
 } // namespace display_server
\ No newline at end of file
index aeaa130..9264548 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _DSPOLICYAREA_H_
 #define _DSPOLICYAREA_H_
 
+#include <DSSeat.h>
+
 namespace display_server
 {
 class DSPolicyArea
@@ -9,8 +11,14 @@ public:
        DSPolicyArea();
        virtual ~DSPolicyArea();
 
+       bool setPosition(int x, int y);
+       bool setSize(int width, int height);
+       bool attachSeat(DSSeat *seat);
+
 private:
-       /* data */
+       int __x, __y;
+       int __width, __height;
+       DSSeat *__seat;
 };
 }
 
index a1a20e5..ed4e1a4 100644 (file)
@@ -18,3 +18,13 @@ TEST_F(DSPolicyAreaTest, NewDSPolicyArea)
        delete policyArea;
        ASSERT_TRUE(true);
 }
+
+TEST_F(DSPolicyAreaTest, BasicMethods)
+{
+       DSPolicyArea policyArea;
+       DSSeat seat;
+
+       EXPECT_TRUE(policyArea.setPosition(10, 10) == true);
+       EXPECT_TRUE(policyArea.setSize(100, 100) == true);
+       EXPECT_TRUE(policyArea.attachSeat(&seat) == true);
+}
\ No newline at end of file