summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmap/tst_qmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qmap/tst_qmap.cpp')
-rw-r--r--tests/auto/qmap/tst_qmap.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qmap/tst_qmap.cpp b/tests/auto/qmap/tst_qmap.cpp
index a1b8de72fd..311b0b6e46 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()
{
{