Fix potential crash: adding int to string
qtbase/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp:652:36: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
f.write(QByteArray("i am " + i));
~~~~~~~~^~~
qtbase/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp:652:36: note: use array indexing to silence this warning
f.write(QByteArray("i am " + i));
^
& [ ]
Change-Id: Icc966559be3c2cde3416193b8a1ddab7e0323ade
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
parent
1c1771effc
commit
f191fe7cab
|
|
@ -649,7 +649,7 @@ void tst_QFileSystemWatcher::signalsEmittedAfterFileMoved()
|
|||
for (int i = 0; i < 10; i++) {
|
||||
QFile f(testDir.filePath(QString("test%1.txt").arg(i)));
|
||||
QVERIFY(f.open(QIODevice::WriteOnly));
|
||||
f.write(QByteArray("i am " + i));
|
||||
f.write(QByteArray("i am ") + QByteArray::number(i));
|
||||
f.close();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue