summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-08-25 11:23:18 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-02-13 18:18:32 +0000
commitafc7da09ec01b1658451d36c52f22c0d203f593d (patch)
tree737e3497b4cfb3df14a8d678b2fbcd0fa104d4cf /tests/auto/gui
parent0df5c366e50b9533fd8ea3f31c4c360ae7f4c5b6 (diff)
QRegion: add move ctor
After this change, this was the distribution of calls in QtGui and QtWidgets when the patch was developed for 5.4: QtGui QtWidgets move 23 63 copy 23 36 Change-Id: If3f536e52fc242c585e7fa0662049c0657efcc9c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'tests/auto/gui')
-rw-r--r--tests/auto/gui/painting/qregion/tst_qregion.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/gui/painting/qregion/tst_qregion.cpp b/tests/auto/gui/painting/qregion/tst_qregion.cpp
index 7292841e5d..d24435198e 100644
--- a/tests/auto/gui/painting/qregion/tst_qregion.cpp
+++ b/tests/auto/gui/painting/qregion/tst_qregion.cpp
@@ -45,6 +45,7 @@ public:
tst_QRegion();
private slots:
+ void moveSemantics();
void boundingRect();
void rects();
void swap();
@@ -93,6 +94,28 @@ tst_QRegion::tst_QRegion()
{
}
+void tst_QRegion::moveSemantics()
+{
+ const QRegion rect(QRect(0, 0, 100, 100));
+
+ // move assignment
+ {
+ QRegion r1 = rect;
+ QRegion r2;
+ r2 = std::move(r1);
+ QVERIFY(r1.isNull());
+ QCOMPARE(r2, rect);
+ }
+
+ // move construction
+ {
+ QRegion r1 = rect;
+ QRegion r2 = std::move(r1);
+ QVERIFY(r1.isNull());
+ QCOMPARE(r2, rect);
+ }
+}
+
void tst_QRegion::boundingRect()
{
{