diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-09-25 14:02:04 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-09-25 14:02:04 +0200 |
commit | a1ad9a74ebb3c556c5f70f7e03be68b09598ac53 (patch) | |
tree | 615a96db418219a57a745a5899e39a9ac90744ec /tests/auto/corelib/tools/qhashfunctions | |
parent | 6d78b7a0c46ea04f4bb771d960e2f7dff1362341 (diff) | |
parent | 462f355e4fb16cc7a1838fa2dda0f763eee58c84 (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
src/corelib/io/io.pri
src/corelib/io/qdatastream.cpp
src/corelib/io/qdatastream.h
src/network/socket/qabstractsocket.cpp
src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h
src/widgets/styles/qgtkstyle.cpp
tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/qmimedatabase-cache.pro
tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/qmimedatabase-xml.pro
tests/auto/dbus/qdbusconnection/qdbusconnection.pro
tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp
tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
Change-Id: I347549a024eb5bfa986699e0a11f96cc55c797a7
Diffstat (limited to 'tests/auto/corelib/tools/qhashfunctions')
-rw-r--r-- | tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp index 6961426f59..bde9433a24 100644 --- a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp +++ b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp @@ -50,6 +50,8 @@ private Q_SLOTS: void qthash(); void range(); void rangeCommutative(); + + void setGlobalQHashSeed(); }; void tst_QHashFunctions::qhash() @@ -207,5 +209,21 @@ void tst_QHashFunctions::rangeCommutative() (void)qHashRangeCommutative(hashables, hashables + numHashables); } +void tst_QHashFunctions::setGlobalQHashSeed() +{ + // Setter works as advertised + qSetGlobalQHashSeed(0x10101010); + QCOMPARE(qGlobalQHashSeed(), 0x10101010); + + // Creating a new QHash doesn't reset the seed + QHash<QString, int> someHash; + someHash.insert("foo", 42); + QCOMPARE(qGlobalQHashSeed(), 0x10101010); + + // Reset works as advertised + qSetGlobalQHashSeed(-1); + QVERIFY(qGlobalQHashSeed() != -1); +} + QTEST_APPLESS_MAIN(tst_QHashFunctions) #include "tst_qhashfunctions.moc" |