diff options
Diffstat (limited to 'tests/auto/corelib/io')
4 files changed, 21 insertions, 16 deletions
diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index a96d8706ee..2756fcce50 100644 --- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -94,20 +94,31 @@ tst_QFileSystemWatcher::tst_QFileSystemWatcher() void tst_QFileSystemWatcher::basicTest_data() { QTest::addColumn<QString>("backend"); - QTest::newRow("native backend") << "native"; - QTest::newRow("poller backend") << "poller"; + QTest::addColumn<QString>("testFileName"); + const QString testFile = QStringLiteral("testfile.txt"); + // QTBUG-31341: Test the UNICODE capabilities; ensure no QString::toLower() + // is in the code path since that will lower case for example + // LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE with context, whereas the Windows file + // system will not. + const QString specialCharacterFile = + QString(QChar(ushort(0x130))) // LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE + + QChar(ushort(0x00DC)) // LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS + + QStringLiteral(".txt"); + + QTest::newRow("native backend-testfile") << "native" << testFile; + QTest::newRow("poller backend-testfile") << "poller" << testFile; + QTest::newRow("native backend-specialchars") << "native" << specialCharacterFile; } void tst_QFileSystemWatcher::basicTest() { QFETCH(QString, backend); + QFETCH(QString, testFileName); // create test file QTemporaryDir temporaryDirectory(m_tempDirPattern); QVERIFY(temporaryDirectory.isValid()); - QFile testFile(temporaryDirectory.path() + QStringLiteral("/testfile.txt")); - testFile.setPermissions(QFile::ReadOwner | QFile::WriteOwner); - testFile.remove(); + QFile testFile(temporaryDirectory.path() + QLatin1Char('/') + testFileName); QVERIFY(testFile.open(QIODevice::WriteOnly | QIODevice::Truncate)); testFile.write(QByteArray("hello")); testFile.close(); diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index 613bfd5c17..3862553a4b 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -267,15 +267,7 @@ void tst_QProcess::simpleStart() QCOMPARE(process->state(), QProcess::Running); QVERIFY2(process->waitForStarted(5000), qPrintable(process->errorString())); QCOMPARE(process->state(), QProcess::Running); -#if defined(Q_OS_WINCE) - // Note: This actually seems incorrect, it will only exit the while loop when finishing fails - while (process->waitForFinished(5000)) - { } -#else - while (process->waitForReadyRead(5000)) - { } -#endif - QCOMPARE(int(process->state()), int(QProcess::NotRunning)); + QTRY_COMPARE(process->state(), QProcess::NotRunning); delete process; process = 0; diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index 698dc5ca72..9b757ab934 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -1941,7 +1941,10 @@ void tst_QUrl::strictParser_data() QTest::newRow("invalid-ipvfuture-3") << "http://[v789]" << "Invalid IPvFuture address"; QTest::newRow("unbalanced-brackets") << "http://[ff02::1" << "Expected ']' to match '[' in hostname"; - // invalid IDN hostnames happen in TolerantMode too + // invalid hostnames happen in TolerantMode too + QTest::newRow("invalid-hostname-leading-dot") << "http://.co.uk" << "Invalid hostname (contains invalid characters)"; + QTest::newRow("invalid-hostname-double-dot") << "http://co..uk" << "Invalid hostname (contains invalid characters)"; + QTest::newRow("invalid-hostname-non-LDH") << "http://foo,bar.example.com" << "Invalid hostname (contains invalid characters)"; QTest::newRow("idn-prohibited-char-space") << "http:// " << "Invalid hostname (contains invalid characters)"; QTest::newRow("idn-prohibited-char-nbsp") << "http://\xc2\xa0" << "Invalid hostname (contains invalid characters)"; QTest::newRow("idn-prohibited-char-control-1f") << "http://\x1f" << "Invalid hostname (contains invalid characters)"; diff --git a/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp b/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp index bad77b1e06..0944f32443 100644 --- a/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp +++ b/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp @@ -175,7 +175,6 @@ void tst_QWinOverlappedIoNotifier::waitForNotified() HANDLE hFile = CreateFile(reinterpret_cast<const wchar_t*>(fileName.utf16()), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); - QCOMPARE(notifier.waitForNotified(0, 0), false); notifier.setHandle(hFile); notifier.setEnabled(true); QCOMPARE(notifier.waitForNotified(100, 0), false); |