From 7e7bc031e905a6c8181b095cdb166f183aace9ec Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Mon, 8 May 2017 12:08:13 +0200 Subject: 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 --- .../kernel/qcoreapplication/tst_qcoreapplication.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp') 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(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]; -- cgit v1.2.3