diff options
Diffstat (limited to 'tests/auto/corelib/io/qtemporarydir')
-rw-r--r-- | tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp index 21936faca5..6dbb8ddd0d 100644 --- a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp +++ b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp @@ -139,25 +139,24 @@ void tst_QTemporaryDir::fileTemplate_data() { QTest::addColumn<QString>("constructorTemplate"); QTest::addColumn<QString>("prefix"); + QTest::addColumn<QString>("suffix"); + + QTest::newRow("default") << "" << "tst_qtemporarydir-" << ""; - QTest::newRow("constructor default") << "" << "tst_qtemporarydir-"; - - QTest::newRow("constructor with xxx sufix") << "qt_XXXXXXxxx" << "qt_XXXXXXxxx"; - QTest::newRow("constructor with xXx sufix") << "qt_XXXXXXxXx" << "qt_XXXXXXxXx"; - QTest::newRow("constructor with no suffix") << "qt_XXXXXX" << "qt_"; - QTest::newRow("constructor with >6 X's, no suffix") << "qt_XXXXXXXXXX" << "qt_"; - // When more than 6 X are present at the end, linux and windows will only replace the last 6, - // while Mac OS will actually replace all of them so we can only expect "qt_" (and check isValid). - QTest::newRow("constructor with XXXX suffix") << "qt_XXXXXX_XXXX" << "qt_"; - QTest::newRow("constructor with XXXX prefix") << "qt_XXXX" << "qt_"; - QTest::newRow("constructor with XXXXX prefix") << "qt_XXXXX" << "qt_"; + QTest::newRow("xxx-suffix") << "qt_XXXXXXxxx" << "qt_" << "xxx"; + QTest::newRow("xXx-suffix") << "qt_XXXXXXxXx" << "qt_" << "xXx"; + QTest::newRow("no-suffix") << "qt_XXXXXX" << "qt_" << ""; + QTest::newRow("10X") << "qt_XXXXXXXXXX" << "qt_" << ""; + QTest::newRow("4Xsuffix") << "qt_XXXXXX_XXXX" << "qt_" << "_XXXX"; + QTest::newRow("4Xprefix") << "qt_XXXX" << "qt_XXXX" << ""; + QTest::newRow("5Xprefix") << "qt_XXXXX" << "qt_XXXXX" << ""; if (QTestPrivate::canHandleUnicodeFileNames()) { // Test Umlauts (contained in Latin1) QString prefix = "qt_" + umlautTestText(); - QTest::newRow("Umlauts") << (prefix + "XXXXXX") << prefix; - // Test Chinese + QTest::newRow("Umlauts") << (prefix + "XXXXXX") << prefix << ""; + // test non-Latin1 prefix = "qt_" + hanTestText(); - QTest::newRow("Chinese characters") << (prefix + "XXXXXX") << prefix; + QTest::newRow("Chinese") << (prefix + "XXXXXX" + umlautTestText()) << prefix << umlautTestText(); } } @@ -165,14 +164,17 @@ void tst_QTemporaryDir::fileTemplate() { QFETCH(QString, constructorTemplate); QFETCH(QString, prefix); + QFETCH(QString, suffix); QTemporaryDir tempDir(constructorTemplate); QVERIFY(tempDir.isValid()); QString dirName = QDir(tempDir.path()).dirName(); - if (prefix.length()) + if (prefix.length()) { QCOMPARE(dirName.left(prefix.length()), prefix); + QCOMPARE(dirName.right(suffix.length()), suffix); + } } |