summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qpoint
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@nokia.com>2012-07-06 15:12:41 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-12 01:46:20 +0200
commit623bfe209371b6d35d030a66629b58f0f4f27b0d (patch)
treef4e710544947c86ad95df98101dce2411570f5f9 /tests/auto/corelib/tools/qpoint
parent74b0206a714a32102a7ea5dcc6dad580bd4a600c (diff)
Add unary operator+ to QPoint and QPointF.
As requested by Winfried Schenke: "QPoint should have an unary operator+ (the unary operator- exists). Classes with arithmetic operators should provide a complete set of operators, because some template code relies on it." Task-number: QTBUG-22913 Change-Id: Ib0c5105975f56c15f00bb48d83c8d911f5a204ac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'tests/auto/corelib/tools/qpoint')
-rw-r--r--tests/auto/corelib/tools/qpoint/tst_qpoint.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp b/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp
index 9f30fe6e4a..cb24325765 100644
--- a/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp
+++ b/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp
@@ -71,6 +71,9 @@ private slots:
void operator_divide_data();
void operator_divide();
+ void operator_unary_plus_data();
+ void operator_unary_plus();
+
void operator_unary_minus_data();
void operator_unary_minus();
@@ -269,6 +272,18 @@ void tst_QPoint::operator_divide()
QCOMPARE(point, expected);
}
+void tst_QPoint::operator_unary_plus_data()
+{
+ operator_unary_minus_data();
+}
+
+void tst_QPoint::operator_unary_plus()
+{
+ QFETCH(QPoint, point);
+ // Should be a NOOP.
+ QCOMPARE(+point, point);
+}
+
void tst_QPoint::operator_unary_minus_data()
{
QTest::addColumn<QPoint>("point");