summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmap
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qmap')
-rw-r--r--tests/auto/qmap/qmap.pro1
-rw-r--r--tests/auto/qmap/tst_qmap.cpp12
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qmap/qmap.pro b/tests/auto/qmap/qmap.pro
index 00b84d1..eaed926 100644
--- a/tests/auto/qmap/qmap.pro
+++ b/tests/auto/qmap/qmap.pro
@@ -4,3 +4,4 @@ QT = core
SOURCES += tst_qmap.cpp
QT = core
+CONFIG += parallel_test
diff --git a/tests/auto/qmap/tst_qmap.cpp b/tests/auto/qmap/tst_qmap.cpp
index a1b8de7..311b0b6 100644
--- a/tests/auto/qmap/tst_qmap.cpp
+++ b/tests/auto/qmap/tst_qmap.cpp
@@ -65,6 +65,8 @@ private slots:
void beginEnd();
void key();
+ void swap();
+
void operator_eq();
void empty();
@@ -392,6 +394,16 @@ void tst_QMap::key()
}
}
+void tst_QMap::swap()
+{
+ QMap<int,QString> m1, m2;
+ m1[0] = "m1[0]";
+ m2[1] = "m2[1]";
+ m1.swap(m2);
+ QCOMPARE(m1.value(1),QLatin1String("m2[1]"));
+ QCOMPARE(m2.value(0),QLatin1String("m1[0]"));
+}
+
void tst_QMap::operator_eq()
{
{