summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2018-07-11 20:38:58 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2018-07-26 16:35:59 +0000
commit0b688e29556bfee806bedb17b89a6ce6689e7979 (patch)
tree2a8d136cb2e321f7568324475f6b5ddb46c6be84 /tests/auto/corelib/tools
parenta5d8f00b3b979d7846ce7029edf4187b96ce1f4e (diff)
Check against copying the husk left by a move
The copy-assign operator tests against other.d being NULL but the copy-constructor didn't. This can only matter if the value being copied has been moved from, so we could probably replace with an assertion in practice, but we should at least be consistent. Amended test to check this case too; and verified new test crashes without this fix. Change-Id: I46872a677775944bbdf6a9112e719873e574ae60 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r--tests/auto/corelib/tools/qcollator/tst_qcollator.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp
index 480e723f44..00b22dab6c 100644
--- a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp
+++ b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp
@@ -72,6 +72,9 @@ void tst_QCollator::moveSemantics()
QCOMPARE(c2.locale(), de_AT);
QVERIFY(dpointer_is_null(c1));
+ QCollator c3(c1);
+ QVERIFY(dpointer_is_null(c3));
+
c1 = std::move(c2);
QCOMPARE(c1.locale(), de_AT);
QVERIFY(dpointer_is_null(c2));