diff options
author | Oliver Wolff <oliver.wolff@qt.io> | 2017-05-08 12:08:13 +0200 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@qt.io> | 2017-05-11 06:37:34 +0000 |
commit | 7e7bc031e905a6c8181b095cdb166f183aace9ec (patch) | |
tree | 229dee5fcf05435e8d00dad7bf2b853390a535a0 /tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp | |
parent | cf969f0be313acc99a1ba4d8ffc4d3adfec8c5cc (diff) |
winrt: Fix tst_qcoreapplication
On winrt, the default application version is determined by its
manifest file. The template's default version is 1.0.0.0.
Additionally addRemoveLibPaths should not fail if libraryPaths
only contains currentDir.
Change-Id: Ifdd517f1bfe2fdf641f3d728ebe1fa144df1a8ca
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp')
-rw-r--r-- | tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp index 31e76c4407..22f0d8ecaa 100644 --- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp +++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp @@ -155,7 +155,9 @@ void tst_QCoreApplication::qAppName() void tst_QCoreApplication::qAppVersion() { -#if defined(Q_OS_WIN) +#if defined(Q_OS_WINRT) + const char appVersion[] = "1.0.0.0"; +#elif defined(Q_OS_WIN) const char appVersion[] = "1.2.3.4"; #elif defined(Q_OS_DARWIN) || defined(Q_OS_ANDROID) const char appVersion[] = "1.2.3"; @@ -946,9 +948,12 @@ void tst_QCoreApplication::addRemoveLibPaths() char *argv[] = { const_cast<char*>(QTest::currentAppName()) }; TestApplication app(argc, argv); - // Check that modifications stay alive across the creation of an application. - QVERIFY(QCoreApplication::libraryPaths().contains(currentDir)); - QVERIFY(!QCoreApplication::libraryPaths().contains(paths[0])); + // If libraryPaths only contains currentDir, neither will be in libraryPaths now. + if (paths.length() != 1 && currentDir != paths[0]) { + // Check that modifications stay alive across the creation of an application. + QVERIFY(QCoreApplication::libraryPaths().contains(currentDir)); + QVERIFY(!QCoreApplication::libraryPaths().contains(paths[0])); + } QStringList replace; replace << currentDir << paths[0]; |