summaryrefslogtreecommitdiffstats
path: root/tests/auto/qhash
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qhash')
-rw-r--r--tests/auto/qhash/qhash.pro1
-rw-r--r--tests/auto/qhash/tst_qhash.cpp11
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qhash/qhash.pro b/tests/auto/qhash/qhash.pro
index 86b98a2..16c9eab 100644
--- a/tests/auto/qhash/qhash.pro
+++ b/tests/auto/qhash/qhash.pro
@@ -6,3 +6,4 @@ symbian: {
TARGET.EPOCSTACKSIZE =0x5000
TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
}
+CONFIG += parallel_test
diff --git a/tests/auto/qhash/tst_qhash.cpp b/tests/auto/qhash/tst_qhash.cpp
index 3a7b54a..ea6e010 100644
--- a/tests/auto/qhash/tst_qhash.cpp
+++ b/tests/auto/qhash/tst_qhash.cpp
@@ -60,6 +60,7 @@ private slots:
void erase();
void key();
+ void swap();
void count(); // copied from tst_QMap
void clear(); // copied from tst_QMap
void empty(); // copied from tst_QMap
@@ -553,6 +554,16 @@ void tst_QHash::key()
}
}
+void tst_QHash::swap()
+{
+ QHash<int,QString> h1, h2;
+ h1[0] = "h1[0]";
+ h2[1] = "h2[1]";
+ h1.swap(h2);
+ QCOMPARE(h1.value(1),QLatin1String("h2[1]"));
+ QCOMPARE(h2.value(0),QLatin1String("h1[0]"));
+}
+
// copied from tst_QMap
void tst_QHash::clear()
{