diff options
author | Robert Griebl <robert.griebl@qt.io> | 2020-02-07 16:25:19 +0100 |
---|---|---|
committer | Robert Griebl <robert.griebl@qt.io> | 2020-02-10 17:03:55 +0000 |
commit | db6109928b83432b68018178577eaea55db90021 (patch) | |
tree | a66443153c0b7b256f5c2a866e7e5822d25d26ec | |
parent | 47049dfb737bc404f909b1ed6e0d9e39cd89e2e6 (diff) | |
download | qtapplicationmanager-db6109928b83432b68018178577eaea55db90021.tar.gz |
Fix failing auto-tests
Change-Id: I61defc60c9d7616a67ee6c53af42f76de17be246
Fixes: AUTOSUITE-1461
Reviewed-by: Dominik Holland <dominik.holland@qt.io>
-rw-r--r-- | src/common-lib/utilities.cpp | 7 | ||||
-rw-r--r-- | src/package-lib/packageextractor.cpp | 2 | ||||
-rw-r--r-- | tests/applicationinstaller/tst_applicationinstaller.cpp | 2 | ||||
-rw-r--r-- | tests/qml/installer/tst_installer.qml | 3 | ||||
-rw-r--r-- | tests/tests.pro | 1 |
5 files changed, 9 insertions, 6 deletions
diff --git a/src/common-lib/utilities.cpp b/src/common-lib/utilities.cpp index c70d6abb..cc21dfed 100644 --- a/src/common-lib/utilities.cpp +++ b/src/common-lib/utilities.cpp @@ -147,15 +147,16 @@ YamlFormat checkYamlFormat(const QVector<QVariant> &docs, int numberOfDocuments, void operator()(const QPair<QString, int> &typeAndVersion) { if (!m_str.isEmpty()) - m_str += qSL(", or "); - m_str = m_str + typeAndVersion.first + qSL(" version ") + QString::number(typeAndVersion.second); + m_str += qSL(" or "); + m_str = m_str + qSL("type '") + typeAndVersion.first + qSL("', version '") + + QString::number(typeAndVersion.second) + qL1C('\''); } private: QString m_str; }; if (!formatTypesAndVersions.contains(actualFormatTypeAndVersion)) { - throw Exception("wrong header: expected %1, got %2") + throw Exception("wrong header: expected %1, but instead got %2") .arg(std::for_each(formatTypesAndVersions.cbegin(), formatTypesAndVersions.cend(), StringifyTypeAndVersion()).string()) .arg(StringifyTypeAndVersion(actualFormatTypeAndVersion).string()); } diff --git a/src/package-lib/packageextractor.cpp b/src/package-lib/packageextractor.cpp index 2e1b210d..b9e453bf 100644 --- a/src/package-lib/packageextractor.cpp +++ b/src/package-lib/packageextractor.cpp @@ -465,7 +465,7 @@ void PackageExtractorPrivate::processMetaData(const QByteArray &metadata, QCrypt } const QString formatType = isHeader ? qSL("am-package-header") : qSL("am-package-footer"); - bool formatVersion = 0; + int formatVersion = 0; try { formatVersion = checkYamlFormat(docs, -2 /*at least 2 docs*/, { { formatType, 2 }, { formatType, 1 } }).second; diff --git a/tests/applicationinstaller/tst_applicationinstaller.cpp b/tests/applicationinstaller/tst_applicationinstaller.cpp index bb73c758..7128e18e 100644 --- a/tests/applicationinstaller/tst_applicationinstaller.cpp +++ b/tests/applicationinstaller/tst_applicationinstaller.cpp @@ -395,7 +395,7 @@ void tst_PackageManager::packageInstallation_data() << false << false << false << false << nomd << "The package icon (as stated in info.yaml) must be the second file in the package. Expected 'icon.png', got 'test'"; QTest::newRow("invalid-header-format") \ << "test-invalid-header-formatversion.appkg" << "" - << false << false << false << false << nomd << "metadata has an invalid format specification: wrong header: expected am-package-header version 2, got am-package-header version 0"; + << false << false << false << false << nomd << "metadata has an invalid format specification: wrong header: expected type 'am-package-header', version '2' or type 'am-package-header', version '1', but instead got type 'am-package-header', version '0'"; QTest::newRow("invalid-header-diskspaceused") \ << "test-invalid-header-diskspaceused.appkg" << "" << false << false << false << false << nomd << "metadata has an invalid diskSpaceUsed field (0)"; diff --git a/tests/qml/installer/tst_installer.qml b/tests/qml/installer/tst_installer.qml index dced0938..3b2e9b25 100644 --- a/tests/qml/installer/tst_installer.qml +++ b/tests/qml/installer/tst_installer.qml @@ -88,6 +88,9 @@ TestCase { // Remove previous installations for (var pkg of [ "hello-world.red", "com.pelagicore.test" ]) { + var po = PackageManager.package(pkg) + if (!po || (po.builtIn && !po.builtInHasRemovableUpdate)) + continue if (PackageManager.removePackage(pkg, false, true)) { taskFinishedSpy.wait(spyTimeout); compare(taskFinishedSpy.count, 1); diff --git a/tests/tests.pro b/tests/tests.pro index bc286247..d71a422e 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -9,7 +9,6 @@ SUBDIRS = \ cryptography \ signature \ utilities \ - yaml \ installationreport \ packagecreator \ packageextractor \ |