summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpoint
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-04-15 12:01:36 +0200
committerGunnar Sletta <gunnar@trolltech.com>2009-04-15 12:05:42 +0200
commit79891d8284736dc318cff8d9c3f6d7a6e87affd9 (patch)
treefe053e870f19f4f2cb218a7d4a6a986e001db7dd /tests/auto/qpoint
parent0d7f704856166aea83843697ae98bdcf22dbabb0 (diff)
Introduce QPointF::manhattanLength
Task-number: 251068
Diffstat (limited to 'tests/auto/qpoint')
-rw-r--r--tests/auto/qpoint/tst_qpoint.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qpoint/tst_qpoint.cpp b/tests/auto/qpoint/tst_qpoint.cpp
index 67fefa89a6..16d55fca57 100644
--- a/tests/auto/qpoint/tst_qpoint.cpp
+++ b/tests/auto/qpoint/tst_qpoint.cpp
@@ -60,6 +60,8 @@ public:
private slots:
void getSetCheck();
void division();
+
+ void manhattanLength();
};
tst_QPoint::tst_QPoint()
@@ -70,6 +72,24 @@ tst_QPoint::~tst_QPoint()
{
}
+
+
+void tst_QPoint::manhattanLength()
+{
+ {
+ QPoint p(10, 20);
+ QCOMPARE(p.manhattanLength(), 30);
+ }
+ {
+ QPointF p(10., 20.);
+ QCOMPARE(p.manhattanLength(), 30.);
+ }
+ {
+ QPointF p(10.1, 20.2);
+ QCOMPARE(p.manhattanLength(), 30.3);
+ }
+}
+
// Testing get/set functions
void tst_QPoint::getSetCheck()
{