summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <dangelog@gmail.com>2012-04-04 21:00:11 +0100
committerQt by Nokia <qt-info@nokia.com>2012-04-06 15:16:40 +0200
commit9ddb822a8672af8495ee6e3e30449800c96589e4 (patch)
treed94ceec5e44acac4cdeb490ef53208f47b23dd79 /tests/auto/corelib
parent10747da77d8df4894eaa7ee256b5bfb68faac635 (diff)
Add test for qHash(QByteArray)
Two equal QByteArrays must return the same hash. Change-Id: Iddd45b0c420213ca2b82bbcb164367acb6104ec8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r--tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
index a30ecb7ab1..b7793051b1 100644
--- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
@@ -43,6 +43,7 @@
#include <qbytearray.h>
#include <qfile.h>
+#include <qhash.h>
#include <limits.h>
#include <private/qtools_p.h>
#if defined(Q_OS_WINCE)
@@ -1557,6 +1558,9 @@ void tst_QByteArray::compare()
QCOMPARE(str2 <= str1, isGreater || isEqual);
QCOMPARE(str2 >= str1, isLess || isEqual);
QCOMPARE(str2 != str1, !isEqual);
+
+ if (isEqual)
+ QVERIFY(qHash(str1) == qHash(str2));
}
void tst_QByteArray::compareCharStar_data()