summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
index 41482f4256..deb6fce563 100644
--- a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
+++ b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
@@ -172,6 +172,7 @@ void tst_QUrlQuery::constructing()
QVERIFY(other != empty);
QVERIFY(!(other == empty));
+ // copy-construct
QUrlQuery copy(other);
QCOMPARE(copy, other);
@@ -179,10 +180,33 @@ void tst_QUrlQuery::constructing()
QVERIFY(copy.isEmpty());
QVERIFY(copy != other);
+ // copy-assign
copy = other;
QVERIFY(!copy.isEmpty());
QCOMPARE(copy, other);
+ // move-construct
+ QUrlQuery moved(std::move(other));
+ QCOMPARE(moved, copy);
+
+ // self move-assign
+ moved = std::move(moved);
+ QCOMPARE(moved, copy);
+
+ // self move-assign of moved-from (Hinnant Criterion)
+ other = std::move(other);
+ // shouldn't crash; here, or further down
+
+ // copy-assign to moved-from object
+ other = copy;
+ QCOMPARE(other, copy);
+ QCOMPARE(other, moved);
+
+ // move-assign
+ moved = std::move(other);
+ QCOMPARE(moved, copy);
+
+ // (move-)assign default-constructed
copy = QUrlQuery();
QVERIFY(copy.isEmpty());