summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/QtCore/CMakeLists.txt1
-rw-r--r--tests/QtCore/qeasingcurve_test.py26
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index c0829f4..cd9efca 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -40,6 +40,7 @@ PYSIDE_TEST(qcoreapplication_instance_test.py)
PYSIDE_TEST(qdatastream_test.py)
PYSIDE_TEST(qdatetime_test.py)
PYSIDE_TEST(qdate_test.py)
+PYSIDE_TEST(qeasingcurve_test.py)
PYSIDE_TEST(qenum_test.py)
PYSIDE_TEST(qevent_test.py)
PYSIDE_TEST(qfileinfo_test.py)
diff --git a/tests/QtCore/qeasingcurve_test.py b/tests/QtCore/qeasingcurve_test.py
new file mode 100644
index 0000000..77c0e6c
--- /dev/null
+++ b/tests/QtCore/qeasingcurve_test.py
@@ -0,0 +1,26 @@
+import unittest
+
+from PySide.QtCore import QEasingCurve
+
+def myFunction(progress):
+ if progress == 1.0:
+ return 100.0
+ else:
+ return -100.0
+
+class TestQEasingCurve(unittest.TestCase):
+ def testCustomType(self):
+ ec = QEasingCurve()
+ ec.setCustomType(myFunction)
+ self.assertEqual(ec.valueForProgress(1.0), 100.0)
+ self.assertEqual(ec.valueForProgress(0.5), -100.0)
+
+ def testObjectCleanup(self):
+ for i in range(100):
+ ec = QEasingCurve()
+ ec.setCustomType(myFunction)
+ self.assertEqual(ec.valueForProgress(1.0), 100.0)
+ self.assertEqual(ec.valueForProgress(0.5), -100.0)
+
+if __name__ == '__main__':
+ unittest.main()