summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qeasingcurve
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2012-02-18 08:52:51 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-21 15:28:40 +0100
commit6a6178702e8af97b943c728f1cb4ab20233835a2 (patch)
treead6992321cd77c7a676762f68ae9cbcbcb12af39 /tests/auto/corelib/tools/qeasingcurve
parent5d6b2d5e343e27940e5fd78cb2aa897aac6bc2ed (diff)
QEasingCurve: implement move-assignment operator
Implemented as in QPen etc. Change-Id: I65b43c6ec7308ca4b44f614594c15c41ab2f89f9 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/tools/qeasingcurve')
-rw-r--r--tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
index d5d7ddeb1d..1d4e91dc00 100644
--- a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
+++ b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
@@ -43,6 +43,10 @@
#include <qeasingcurve.h>
+#ifdef Q_COMPILER_RVALUE_REFS // cpp11() slot
+# include <utility> // for std::move()
+#endif
+
class tst_QEasingCurve : public QObject
{
Q_OBJECT
@@ -61,6 +65,7 @@ private slots:
void tcbSpline();
void testCbrtDouble();
void testCbrtFloat();
+ void cpp11();
};
void tst_QEasingCurve::type()
@@ -770,5 +775,19 @@ void tst_QEasingCurve::testCbrtFloat()
}
}
+void tst_QEasingCurve::cpp11()
+{
+#ifdef Q_COMPILER_RVALUE_REFS
+ {
+ QEasingCurve ec( QEasingCurve::InOutBack );
+ QEasingCurve copy;
+ const QEasingCurve::Type type = copy.type();
+ copy = std::move(ec); // move assignment op
+ QCOMPARE( copy.type(), QEasingCurve::InOutBack );
+ QCOMPARE( ec.type(), type );
+ }
+#endif
+}
+
QTEST_MAIN(tst_QEasingCurve)
#include "tst_qeasingcurve.moc"