Corelib tests: Fix out of bounds string access
Fix warnings: Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt. introduced by qtbase/c2d2757bccc68e1b981df059786c2e76f2969530 (5.14). Change-Id: Ie6f0e2e3bb198a95dd40e7416adc8ffb29f3b2ba Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
94bee657c1
commit
8f0e3ad518
@ -1370,7 +1370,7 @@ void tst_Collections::hash()
|
||||
{
|
||||
typedef QHash<QString, QString> Hash;
|
||||
Hash hash;
|
||||
QString key;
|
||||
QString key = QLatin1String(" ");
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
key[0] = i + '0';
|
||||
for (int j = 0; j < 10; ++j) {
|
||||
|
@ -273,7 +273,7 @@ void tst_QHash::insert1()
|
||||
{
|
||||
typedef QHash<QString, QString> Hash;
|
||||
Hash hash;
|
||||
QString key;
|
||||
QString key = QLatin1String(" ");
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
key[0] = i + '0';
|
||||
for (int j = 0; j < 10; ++j) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user