summaryrefslogtreecommitdiffstats
path: root/tests/auto/qicon/tst_qicon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qicon/tst_qicon.cpp')
-rw-r--r--tests/auto/qicon/tst_qicon.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qicon/tst_qicon.cpp b/tests/auto/qicon/tst_qicon.cpp
index e68664c..6b35378 100644
--- a/tests/auto/qicon/tst_qicon.cpp
+++ b/tests/auto/qicon/tst_qicon.cpp
@@ -70,6 +70,7 @@ private slots:
void actualSize2();
void svgActualSize();
void isNull();
+ void swap();
void bestMatch();
void cacheKey();
void detach();
@@ -259,6 +260,21 @@ void tst_QIcon::isNull() {
QVERIFY(iconSupportedFormat.actualSize(QSize(32, 32)).isValid());
}
+void tst_QIcon::swap()
+{
+ QPixmap p1(1, 1), p2(2, 2);
+ p1.fill(Qt::black);
+ p2.fill(Qt::black);
+
+ QIcon i1(p1), i2(p2);
+ const qint64 i1k = i1.cacheKey();
+ const qint64 i2k = i2.cacheKey();
+ QVERIFY(i1k != i2k);
+ i1.swap(i2);
+ QCOMPARE(i1.cacheKey(), i2k);
+ QCOMPARE(i2.cacheKey(), i1k);
+}
+
void tst_QIcon::bestMatch()
{
QPixmap p1(1, 1);