wasm: Add qdiriterator test + minor runtime fixes
There was a runtime feilure in that we try to create directories until it fails. This does not fail on wasm so added a hardlimit of 20480 Change-Id: I6ef65f7be277fc8775879733f969d2ce008a439a Reviewed-by: Lorn Potter <lorn.potter@gmail.com>bb10
parent
a1a8a20206
commit
7071010880
|
|
@ -57,6 +57,7 @@ if(QT_BUILD_MINIMAL_ANDROID_MULTI_ABI_TESTS)
|
|||
endif()
|
||||
|
||||
if(WASM)
|
||||
add_subdirectory(corelib/io/qdiriterator)
|
||||
add_subdirectory(corelib/io/largefile)
|
||||
add_subdirectory(corelib/io/qdataurl)
|
||||
add_subdirectory(corelib/io/qbuffer)
|
||||
|
|
|
|||
|
|
@ -533,8 +533,15 @@ void tst_QDirIterator::longPath()
|
|||
while (dir.exists(dirName) || dir.mkdir(dirName)) {
|
||||
++n;
|
||||
dirName.append('x');
|
||||
if (n >= 20480)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (n >= 20480)
|
||||
{
|
||||
qWarning("No maximum length on directory names");
|
||||
}
|
||||
|
||||
QDirIterator it(dir.absolutePath(), QDir::NoDotAndDotDot|QDir::Dirs, QDirIterator::Subdirectories);
|
||||
int m = 0;
|
||||
while (it.hasNext()) {
|
||||
|
|
@ -543,13 +550,14 @@ void tst_QDirIterator::longPath()
|
|||
}
|
||||
|
||||
QCOMPARE(n, m);
|
||||
|
||||
dirName.chop(1);
|
||||
while (dirName.size() > 0 && dir.exists(dirName) && dir.rmdir(dirName)) {
|
||||
--n;
|
||||
dirName.chop(1);
|
||||
}
|
||||
dir.cdUp();
|
||||
dir.rmdir("longpaths");
|
||||
QCOMPARE(n, 0);
|
||||
QVERIFY(dir.cdUp());
|
||||
QVERIFY(dir.rmdir("longpaths"));
|
||||
}
|
||||
|
||||
void tst_QDirIterator::dirorder()
|
||||
|
|
|
|||
Loading…
Reference in New Issue