summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-09-25 16:01:09 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2014-10-19 07:32:41 +0200
commit32dfbd6dbf8393dcd4e4eaa557902108a2714326 (patch)
tree8e6d5ec29a1e6633a23822a320c26417923a7c44 /tests
parente8bdc949fc3646ff323a4fb4b83835e089a86b77 (diff)
Add qHash(QSslError) overload
qsslsocket_winrt.cpp defined it locally, which runs the risk of clashes with a potential user-defined qHash(QSslError), so make it public. Also included both .error() and .certificate() in the hash, as both of these are used to determine equality (the WinRT version only used .error()). [ChangeLog][QtNetwork][QSslError] Can now be used in QSet/QHash. Change-Id: Ieb7995bed491ff011d4be9dad544248b56fd4f73 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/network/ssl/qsslerror/tst_qsslerror.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/network/ssl/qsslerror/tst_qsslerror.cpp b/tests/auto/network/ssl/qsslerror/tst_qsslerror.cpp
index 58136f9a68..7fd6dc8233 100644
--- a/tests/auto/network/ssl/qsslerror/tst_qsslerror.cpp
+++ b/tests/auto/network/ssl/qsslerror/tst_qsslerror.cpp
@@ -64,6 +64,7 @@ public:
#ifndef QT_NO_SSL
private slots:
void constructing();
+ void hash();
#endif
private:
@@ -79,6 +80,14 @@ void tst_QSslError::constructing()
QSslError error;
}
+void tst_QSslError::hash()
+{
+ // mostly a compile-only test, to check that qHash(QSslError) is found
+ QSet<QSslError> errors;
+ errors << QSslError();
+ QCOMPARE(errors.size(), 1);
+}
+
#endif // QT_NO_SSL
QTEST_MAIN(tst_QSslError)