diff options
Diffstat (limited to 'tests/auto/corelib/tools/qhash')
-rw-r--r-- | tests/auto/corelib/tools/qhash/tst_qhash.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp index 16fb123256..fc669628b5 100644 --- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp +++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp @@ -79,6 +79,8 @@ private slots: void iterators(); // sligthly modified from tst_QMap void keys_values_uniqueKeys(); // slightly modified from tst_QMap void noNeedlessRehashes(); + + void const_shared_null(); }; struct Foo { @@ -1237,5 +1239,16 @@ void tst_QHash::noNeedlessRehashes() } } +void tst_QHash::const_shared_null() +{ + QHash<int, QString> hash1; + hash1.setSharable(false); + QVERIFY(hash1.isDetached()); + + QHash<int, QString> hash2; + hash2.setSharable(true); + QVERIFY(!hash2.isDetached()); +} + QTEST_APPLESS_MAIN(tst_QHash) #include "tst_qhash.moc" |