[kms-tests] [PATCH 2/6] kmstest: Add additional geometry classes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add Dist, Point and Size classes in addition to the Rect class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
---
 tests/kmstest.py | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/tests/kmstest.py b/tests/kmstest.py
index 0281c6727271..949bb20b8b1a 100755
--- a/tests/kmstest.py
+++ b/tests/kmstest.py
@@ -205,6 +205,37 @@ class CRCReader(object):
         return crcs
 
 
+class Dist(object):
+    def __init__(self, x, y):
+        self.x = x
+        self.y = y
+
+    def __repr__(self):
+        return "(%d,%d)" % (self.x, self.y)
+
+
+class Point(object):
+    def __init__(self, x, y):
+        self.x = x
+        self.y = y
+
+    def __repr__(self):
+        return "(%d,%d)" % (self.x, self.y)
+
+    def move(self, distance):
+        self.x += distance.x
+        self.y += distance.y
+
+
+class Size(object):
+    def __init__(self, width, height):
+        self.width = width
+        self.height = height
+
+    def __repr__(self):
+        return "%ux%u" % (self.width, self.height)
+
+
 class Rect(object):
     def __init__(self, left, top, width, height):
         self.left = left
-- 
Regards,

Laurent Pinchart




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux