aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtGui
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-04-19 18:09:17 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:14 -0300
commitc104fa61ad68ece261cc459e7ac31e0a5ac7e3f9 (patch)
tree932677e26b1bb3365549cd369ab926705d47545e /tests/QtGui
parent6ec7cd56a32680a182849817843ef95145986add (diff)
Fix bug 760 - "Method "void QMatrix::map(int x,int y,int* tx,int* ty)const" missing"
Fix bug 761 - "Method "void QMatrix::map(qreal x, qreal y, qreal* tx, qreal* ty) const" missing"
Diffstat (limited to 'tests/QtGui')
-rw-r--r--tests/QtGui/qmatrix_test.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/QtGui/qmatrix_test.py b/tests/QtGui/qmatrix_test.py
index 7c87e23a4..d1fa91ec6 100644
--- a/tests/QtGui/qmatrix_test.py
+++ b/tests/QtGui/qmatrix_test.py
@@ -44,6 +44,15 @@ class QMatrixTest(unittest.TestCase):
d = m.copyDataTo()
self.assert_(my_data == list(d))
+ def testMatrixMapping(self):
+ m = QMatrix(1.0, 2.0, 1.0, 3.0, 100.0, 200.0)
+ res = m.map(5, 5)
+ self.assertAlmostEqual(res[0], 5 * 1.0 + 5 * 1.0 + 100.0)
+ self.assertAlmostEqual(res[1], 5 * 2.0 + 5 * 3.0 + 200.0)
+ res = m.map(5.0, 5.0)
+ self.assertAlmostEqual(res[0], 5.0 * 1.0 + 5.0 * 1.0 + 100.0)
+ self.assertAlmostEqual(res[1], 5.0 * 2.0 + 5.0 * 3.0 + 200.0)
+
if __name__ == '__main__':
unittest.main()