aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/tests
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside2/tests')
-rw-r--r--sources/pyside2/tests/QtGui/qmatrix_test.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/sources/pyside2/tests/QtGui/qmatrix_test.py b/sources/pyside2/tests/QtGui/qmatrix_test.py
index cac8a7ab7..a917199c1 100644
--- a/sources/pyside2/tests/QtGui/qmatrix_test.py
+++ b/sources/pyside2/tests/QtGui/qmatrix_test.py
@@ -29,7 +29,7 @@
import unittest
from PySide2.QtCore import QPoint
-from PySide2.QtGui import QMatrix, QMatrix4x4
+from PySide2.QtGui import QMatrix, QMatrix2x2, QMatrix4x4
def qpointTimesQMatrix(point, matrix):
@@ -49,6 +49,19 @@ class QMatrixTest(unittest.TestCase):
point = QPoint(3, 3)
self.assertRaises(TypeError, matrix.__mul__, point)
+ def testMatrix2x2(self):
+ matrix = QMatrix2x2([1.0, 2.0, 3.0, 4.0])
+
+ expectedTransposed = QMatrix2x2([1.0, 3.0, 2.0, 4.0])
+ self.assertEqual(matrix.transposed(), expectedTransposed)
+
+ expectedMultiplied = QMatrix2x2([2.0, 4.0, 6.0, 8.0])
+ matrix *= 2.0
+ self.assertEqual(matrix, expectedMultiplied)
+
+ matrix.setToIdentity()
+ self.assertTrue(matrix.isIdentity())
+
def testMatrix4x4(self):
self.assertRaises(TypeError, QMatrix4x4, [0.0, 1.0, 2.0, 3.0])
self.assertRaises(TypeError, QMatrix4x4, [0.0, 1.0, 2.0, 'I',