summaryrefslogtreecommitdiffstats
path: root/tests/auto/qicon
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qicon')
-rw-r--r--tests/auto/qicon/qicon.pro12
-rw-r--r--tests/auto/qicon/tst_qicon.cpp16
2 files changed, 22 insertions, 6 deletions
diff --git a/tests/auto/qicon/qicon.pro b/tests/auto/qicon/qicon.pro
index 68b888d..975aaf2 100644
--- a/tests/auto/qicon/qicon.pro
+++ b/tests/auto/qicon/qicon.pro
@@ -5,10 +5,10 @@ RESOURCES = tst_qicon.qrc
wince* {
QT += xml svg
- addFiles.sources += $$_PRO_FILE_PWD_/*.png
- addFiles.sources += $$_PRO_FILE_PWD_/*.svg
- addFiles.sources += $$_PRO_FILE_PWD_/*.svgz
- addFiles.sources += $$_PRO_FILE_PWD_/tst_qicon.cpp
+ addFiles.files += $$_PRO_FILE_PWD_/*.png
+ addFiles.files += $$_PRO_FILE_PWD_/*.svg
+ addFiles.files += $$_PRO_FILE_PWD_/*.svgz
+ addFiles.files += $$_PRO_FILE_PWD_/tst_qicon.cpp
addFiles.path = .
DEPLOYMENT += addFiles
@@ -16,11 +16,11 @@ wince* {
DEFINES += SRCDIR=\\\".\\\"
} else:symbian {
QT += xml svg
- addFiles.sources = *.png tst_qicon.cpp *.svg *.svgz
+ addFiles.files = *.png tst_qicon.cpp *.svg *.svgz
addFiles.path = .
DEPLOYMENT += addFiles
qt_not_deployed {
- plugins.sources = qsvgicon.dll
+ plugins.files = qsvgicon.dll
plugins.path = iconengines
DEPLOYMENT += plugins
}
diff --git a/tests/auto/qicon/tst_qicon.cpp b/tests/auto/qicon/tst_qicon.cpp
index b8682cf..cd3f84f 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);