diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2018-07-27 11:22:57 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2018-07-31 13:33:14 +0200 |
commit | 23c9d4c98f3c6729b56700edc1d7144b444b16db (patch) | |
tree | 27b20ccbf3c101dbc7bcb1e509882b6c7fc75962 /tests/auto/corelib/io/qdir/tst_qdir.cpp | |
parent | f69a5857d115786f44d053e68c36f74526020e82 (diff) | |
parent | 0ef66e98ccf4946a0e4513ab5fc157df0f0aca4e (diff) |
Merge branch '5.11' into dev
Conflicts:
qmake/library/qmakebuiltins.cpp
src/plugins/platforms/windows/qwindowstabletsupport.h
src/plugins/platforms/xcb/qxcbconnection.cpp
src/plugins/platforms/xcb/qxcbconnection.h
src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
src/plugins/platforms/xcb/qxcbwindow.cpp
src/widgets/styles/qstylesheetstyle.cpp
tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
Done-With: Gatis Paeglis <gatis.paeglis@qt.io>
Change-Id: I000b0eb3cea2a5c7a99b95732bfdd41507cf916e
Diffstat (limited to 'tests/auto/corelib/io/qdir/tst_qdir.cpp')
-rw-r--r-- | tests/auto/corelib/io/qdir/tst_qdir.cpp | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index 83492188a9..afa15fe895 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -56,6 +56,12 @@ #define Q_NO_SYMLINKS #endif +#ifdef Q_OS_WIN +#define DRIVE "Q:" +#else +#define DRIVE +#endif + #ifdef QT_BUILD_INTERNAL QT_BEGIN_NAMESPACE @@ -1385,14 +1391,12 @@ void tst_QDir::absoluteFilePath_data() QTest::addColumn<QString>("expectedFilePath"); #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) - QTest::newRow("UNC") << "//machine" << "share" << "//machine/share"; - QTest::newRow("Drive") << "c:/side/town" << "/my/way/home" << "c:/my/way/home"; -#endif - -#ifdef Q_OS_WIN -#define DRIVE "Q:" -#else -#define DRIVE + QTest::newRow("UNC-rel") << "//machine/share" << "dir" << "//machine/share/dir"; + QTest::newRow("UNC-abs") << "//machine/share/path/to/blah" << "/dir" << "//machine/share/dir"; + QTest::newRow("UNC-UNC") << "//machine/share/path/to/blah" << "//host/share/path" << "//host/share/path"; + QTest::newRow("Drive-UNC") << "c:/side/town" << "//host/share/path" << "//host/share/path"; + QTest::newRow("Drive-LTUNC") << "c:/side/town" << "\\/leaning\\toothpick/path" << "\\/leaning\\toothpick/path"; + QTest::newRow("Drive-abs") << "c:/side/town" << "/my/way/home" << "c:/my/way/home"; #endif QTest::newRow("0") << DRIVE "/etc" << "/passwd" << DRIVE "/passwd"; @@ -1401,8 +1405,10 @@ void tst_QDir::absoluteFilePath_data() QTest::newRow("3") << "relative" << "path" << QDir::currentPath() + "/relative/path"; QTest::newRow("4") << "" << "" << QDir::currentPath(); - QTest::newRow("resource") << ":/prefix" << "foo.bar" << ":/prefix/foo.bar"; -#undef DRIVE + // Resource paths are absolute: + QTest::newRow("resource-rel") << ":/prefix" << "foo.bar" << ":/prefix/foo.bar"; + QTest::newRow("abs-res-res") << ":/prefix" << ":/abc.txt" << ":/abc.txt"; + QTest::newRow("abs-res-path") << DRIVE "/etc" << ":/abc.txt" << ":/abc.txt"; } void tst_QDir::absoluteFilePath() @@ -1517,12 +1523,17 @@ void tst_QDir::filePath_data() QTest::addColumn<QString>("fileName"); QTest::addColumn<QString>("expectedFilePath"); - QTest::newRow("0") << "/etc" << "/passwd" << "/passwd"; - QTest::newRow("1") << "/etc" << "passwd" << "/etc/passwd"; - QTest::newRow("2") << "/" << "passwd" << "/passwd"; - QTest::newRow("3") << "relative" << "path" << "relative/path"; - QTest::newRow("4") << "" << "" << "."; + QTest::newRow("abs-abs") << DRIVE "/etc" << DRIVE "/passwd" << DRIVE "/passwd"; + QTest::newRow("abs-rel") << DRIVE "/etc" << "passwd" << DRIVE "/etc/passwd"; + QTest::newRow("root-rel") << DRIVE "/" << "passwd" << DRIVE "/passwd"; + QTest::newRow("rel-rel") << "relative" << "path" << "relative/path"; + QTest::newRow("empty-empty") << "" << "" << "."; QTest::newRow("resource") << ":/prefix" << "foo.bar" << ":/prefix/foo.bar"; +#ifdef Q_OS_WIN + QTest::newRow("abs-LTUNC") << "Q:/path" << "\\/leaning\\tooth/pick" << "\\/leaning\\tooth/pick"; + QTest::newRow("LTUNC-slash") << "\\/leaning\\tooth/pick" << "/path" << "//leaning/tooth/path"; + QTest::newRow("LTUNC-abs") << "\\/leaning\\tooth/pick" << "Q:/path" << "Q:/path"; +#endif } void tst_QDir::filePath() @@ -1588,6 +1599,9 @@ void tst_QDir::exists2_data() QTest::newRow("2") << "" << false; QTest::newRow("3") << "testData" << true; QTest::newRow("4") << "/testData" << false; +#ifdef Q_OS_WIN + QTest::newRow("abs") << "Q:/testData" << false; +#endif QTest::newRow("5") << "tst_qdir.cpp" << true; QTest::newRow("6") << "/resources.cpp" << false; QTest::newRow("resource0") << ":/prefix/foo.bar" << false; |