summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2009-09-17 11:00:18 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-09-17 11:00:18 (GMT)
commit56987a10b1bedacc6515de4c28240126ab0cbf29 (patch)
tree494f1b473df3faf99253dda64c4398c0a0153d74 /tests
parent7e3cd08a4e3f8ffd01b2acf2cfbf71c49b8eda76 (diff)
parent5ff6081d542b7a2e13bd7c75aff327f75b271b86 (diff)
downloadQt-56987a10b1bedacc6515de4c28240126ab0cbf29.zip
Qt-56987a10b1bedacc6515de4c28240126ab0cbf29.tar.gz
Qt-56987a10b1bedacc6515de4c28240126ab0cbf29.tar.bz2
Merge branch '4.6' of git://scm.dev.nokia.troll.no/qt/qt-releases; branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qfileinfo/tst_qfileinfo.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp
index 853bf88..71e38df 100644
--- a/tests/auto/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp
@@ -411,10 +411,14 @@ void tst_QFileInfo::absolutePath_data()
QString drivePrefix;
#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
drivePrefix = QDir::currentPath().left(2);
+ QString nonCurrentDrivePrefix =
+ drivePrefix.left(1).compare("X", Qt::CaseInsensitive) == 0 ? QString("Y:") : QString("X:");
// Make sure drive-relative paths return correct absolute paths (task 255326)
- QTest::newRow("c:my.dll") << "c:my.dll" << QDir::currentPath() << "my.dll";
- QTest::newRow("x:my.dll") << "x:my.dll" << "X:/" << "my.dll";
+ QTest::newRow("<current drive>:my.dll") << drivePrefix + "my.dll" << QDir::currentPath() << "my.dll";
+ QTest::newRow("<not current drive>:my.dll") << nonCurrentDrivePrefix + "my.dll"
+ << nonCurrentDrivePrefix + "/"
+ << "my.dll";
#endif
QTest::newRow("0") << "/machine/share/dir1/" << drivePrefix + "/machine/share/dir1" << "";
QTest::newRow("1") << "/machine/share/dir1" << drivePrefix + "/machine/share" << "dir1";
@@ -450,13 +454,19 @@ void tst_QFileInfo::absFilePath_data()
QTest::newRow("relativeFileInSubDir") << "temp/tmp.txt" << QDir::currentPath() + "/" + "temp/tmp.txt";
#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
QString curr = QDir::currentPath();
+
curr.remove(0, 2); // Make it a absolute path with no drive specifier: \depot\qt-4.2\tests\auto\qfileinfo
QTest::newRow(".") << curr << QDir::currentPath();
QTest::newRow("absFilePath") << "c:\\home\\andy\\tmp.txt" << "C:/home/andy/tmp.txt";
// Make sure drive-relative paths return correct absolute paths (task 255326)
- QTest::newRow("c:my.dll") << "c:temp/my.dll" << QDir::currentPath() + "/temp/my.dll";
- QTest::newRow("x:my.dll") << "x:temp/my.dll" << "X:/temp/my.dll";
+ QString drivePrefix = QDir::currentPath().left(2);
+ QString nonCurrentDrivePrefix =
+ drivePrefix.left(1).compare("X", Qt::CaseInsensitive) == 0 ? QString("Y:") : QString("X:");
+
+ QTest::newRow("<current drive>:my.dll") << drivePrefix + "temp/my.dll" << QDir::currentPath() + "/temp/my.dll";
+ QTest::newRow("<not current drive>:my.dll") << nonCurrentDrivePrefix + "temp/my.dll"
+ << nonCurrentDrivePrefix + "/temp/my.dll";
#else
QTest::newRow("absFilePath") << "/home/andy/tmp.txt" << "/home/andy/tmp.txt";
#endif