diff options
Diffstat (limited to 'tests')
29 files changed, 58 insertions, 31 deletions
diff --git a/tests/auto/installer/binaryformat/tst_binaryformat.cpp b/tests/auto/installer/binaryformat/tst_binaryformat.cpp index c9cd2b00f..7e0f5ed24 100644 --- a/tests/auto/installer/binaryformat/tst_binaryformat.cpp +++ b/tests/auto/installer/binaryformat/tst_binaryformat.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -51,7 +51,7 @@ struct Layout : public QInstaller::BinaryLayout class TestOperation : public KDUpdater::UpdateOperation { public: - TestOperation(const QString &name) + explicit TestOperation(const QString &name) : KDUpdater::UpdateOperation(nullptr) { setName(name); } diff --git a/tests/auto/installer/clientserver/tst_clientserver.cpp b/tests/auto/installer/clientserver/tst_clientserver.cpp index 23442d5fa..29d4283b9 100644 --- a/tests/auto/installer/clientserver/tst_clientserver.cpp +++ b/tests/auto/installer/clientserver/tst_clientserver.cpp @@ -501,7 +501,7 @@ private slots: QFile file; file.setFileName(filename); file.open(QIODevice::ReadWrite); - const QByteArray ba = file.readLine(); + file.readLine(); file.seek(0); QCOMPARE(file.atEnd(), false); diff --git a/tests/auto/installer/cliinterface/data/repository/A/1.0.2-1content.7z b/tests/auto/installer/cliinterface/data/repository/A/1.0.2-1content.7z Binary files differdeleted file mode 100644 index 5a9383e7e..000000000 --- a/tests/auto/installer/cliinterface/data/repository/A/1.0.2-1content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/repository/A/1.0.2-1content.7z.sha1 b/tests/auto/installer/cliinterface/data/repository/A/1.0.2-1content.7z.sha1 deleted file mode 100644 index fd0bc548c..000000000 --- a/tests/auto/installer/cliinterface/data/repository/A/1.0.2-1content.7z.sha1 +++ /dev/null @@ -1 +0,0 @@ -643cb71b2337d5a49d57a5bc3c636ee9b84c0802
\ No newline at end of file diff --git a/tests/auto/installer/cliinterface/data/repository/A/1.0.2-1meta.7z b/tests/auto/installer/cliinterface/data/repository/A/1.0.2-1meta.7z Binary files differdeleted file mode 100644 index 6ef0b7959..000000000 --- a/tests/auto/installer/cliinterface/data/repository/A/1.0.2-1meta.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/repository/AB/1.0.2-1meta.7z b/tests/auto/installer/cliinterface/data/repository/AB/1.0.2-1meta.7z Binary files differdeleted file mode 100644 index 6b5e5ac91..000000000 --- a/tests/auto/installer/cliinterface/data/repository/AB/1.0.2-1meta.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/repository/B/1.0.0-1content.7z b/tests/auto/installer/cliinterface/data/repository/B/1.0.0-1content.7z Binary files differdeleted file mode 100644 index dfe41ad15..000000000 --- a/tests/auto/installer/cliinterface/data/repository/B/1.0.0-1content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/repository/B/1.0.0-1content.7z.sha1 b/tests/auto/installer/cliinterface/data/repository/B/1.0.0-1content.7z.sha1 deleted file mode 100644 index 50a632b49..000000000 --- a/tests/auto/installer/cliinterface/data/repository/B/1.0.0-1content.7z.sha1 +++ /dev/null @@ -1 +0,0 @@ -c7b9ab370efe036171dda7b71cd95021747cb101
\ No newline at end of file diff --git a/tests/auto/installer/cliinterface/data/repository/B/1.0.0-1meta.7z b/tests/auto/installer/cliinterface/data/repository/B/1.0.0-1meta.7z Binary files differdeleted file mode 100644 index 12d54f94c..000000000 --- a/tests/auto/installer/cliinterface/data/repository/B/1.0.0-1meta.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/repository/C/1.0.0-1content.7z b/tests/auto/installer/cliinterface/data/repository/C/1.0.0-1content.7z Binary files differdeleted file mode 100644 index 7d03dca9c..000000000 --- a/tests/auto/installer/cliinterface/data/repository/C/1.0.0-1content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/repository/C/1.0.0-1content.7z.sha1 b/tests/auto/installer/cliinterface/data/repository/C/1.0.0-1content.7z.sha1 deleted file mode 100644 index 91ead97f0..000000000 --- a/tests/auto/installer/cliinterface/data/repository/C/1.0.0-1content.7z.sha1 +++ /dev/null @@ -1 +0,0 @@ -c8b7076fabaaf6b9d27f27350c577118c24f426b
\ No newline at end of file diff --git a/tests/auto/installer/cliinterface/data/repository/C/1.0.0-1meta.7z b/tests/auto/installer/cliinterface/data/repository/C/1.0.0-1meta.7z Binary files differdeleted file mode 100644 index 46bae0179..000000000 --- a/tests/auto/installer/cliinterface/data/repository/C/1.0.0-1meta.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/repository/Updates.xml b/tests/auto/installer/cliinterface/data/repository/Updates.xml index c7b11dc03..e5bc4f8af 100644 --- a/tests/auto/installer/cliinterface/data/repository/Updates.xml +++ b/tests/auto/installer/cliinterface/data/repository/Updates.xml @@ -35,6 +35,27 @@ <DownloadableArchives>content.7z</DownloadableArchives> <SHA1>5b3939da1af492382c68388fc796837e4c36b876</SHA1> </PackageUpdate> + <PackageUpdate> + <Name>C.virt</Name> + <DisplayName>Virtual subcomponent of C</DisplayName> + <Description>Example virtual component</Description> + <Version>1.0.0-1</Version> + <ReleaseDate>2015-01-01</ReleaseDate> + <Virtual>true</Virtual> + <UpdateFile CompressedSize="222" OS="Any" UncompressedSize="72"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>5b3939da1af492382c68388fc796837e4c36b876</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>C.virt.subcomponent</Name> + <DisplayName>Subcomponent of virtual component</DisplayName> + <Description>Example subcomponent of virtual component</Description> + <Version>1.0.0-1</Version> + <ReleaseDate>2015-01-01</ReleaseDate> + <UpdateFile CompressedSize="222" OS="Any" UncompressedSize="72"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>5b3939da1af492382c68388fc796837e4c36b876</SHA1> + </PackageUpdate> <PackageUpdate> <Name>AB</Name> <DisplayName>AB</DisplayName> diff --git a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0content.7z b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0content.7z Binary files differdeleted file mode 100644 index d7fbf4d8e..000000000 --- a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0content.7z.sha1 b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0content.7z.sha1 deleted file mode 100644 index c5825de47..000000000 --- a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0content.7z.sha1 +++ /dev/null @@ -1 +0,0 @@ -f33d2028e1c61061f7f29e5189f7d66800361dc2
\ No newline at end of file diff --git a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0meta.7z b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0meta.7z Binary files differdeleted file mode 100644 index d783c7c1c..000000000 --- a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0meta.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/AB/1.0.2-1meta.7z b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/AB/1.0.2-1meta.7z Binary files differdeleted file mode 100644 index 20f2aca2d..000000000 --- a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/AB/1.0.2-1meta.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0content.7z b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0content.7z Binary files differdeleted file mode 100644 index bd0bc9352..000000000 --- a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0content.7z.sha1 b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0content.7z.sha1 deleted file mode 100644 index e66535388..000000000 --- a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0content.7z.sha1 +++ /dev/null @@ -1 +0,0 @@ -bb256f1eda0f452c7ab33d1f364a4fad062f0a73
\ No newline at end of file diff --git a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0meta.7z b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0meta.7z Binary files differdeleted file mode 100644 index f92853734..000000000 --- a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0meta.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/Updates.xml b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/Updates.xml index e0aedffdd..f0c724db8 100644 --- a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/Updates.xml +++ b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/Updates.xml @@ -37,4 +37,14 @@ <SHA1>cfa136fa1d7a4196896c90af72d510727ba799ae</SHA1> <Virtual>true</Virtual> </PackageUpdate> + <PackageUpdate> + <Name>B.subcomponent</Name> + <DisplayName>Subcomponent of B</DisplayName> + <Description>Example non-virtual subcomponent of B</Description> + <Version>2.0.0</Version> + <ReleaseDate>2015-01-01</ReleaseDate> + <UpdateFile CompressedSize="224" OS="Any" UncompressedSize="74"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>cfa136fa1d7a4196896c90af72d510727ba799ae</SHA1> + </PackageUpdate> </Updates> diff --git a/tests/auto/installer/cliinterface/tst_cliinterface.cpp b/tests/auto/installer/cliinterface/tst_cliinterface.cpp index 550f45da2..98ea99133 100644 --- a/tests/auto/installer/cliinterface/tst_cliinterface.cpp +++ b/tests/auto/installer/cliinterface/tst_cliinterface.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -89,6 +89,15 @@ private slots: " <package name=\"C\" displayname=\"C\" version=\"1.0.0-1\"/>\n" "</availablepackages>\n"); core->listAvailablePackages(QLatin1String("^C")); + + // Need to change rules here to catch messages + QLoggingCategory::setFilterRules("ifw.* = true\n"); + + QTest::ignoreMessage(QtDebugMsg, "No matching packages found."); + core->listAvailablePackages(QLatin1String("C.virt")); + + QTest::ignoreMessage(QtDebugMsg, "No matching packages found."); + core->listAvailablePackages(QLatin1String("C.virt.subcomponent")); } void testInstallPackageFails() @@ -117,6 +126,11 @@ private slots: << QLatin1String("B"))); QTest::ignoreMessage(QtDebugMsg, "Preparing meta information download..."); + QTest::ignoreMessage(QtDebugMsg, "Cannot install B.subcomponent. Component is descendant of a virtual component B.\n"); + QCOMPARE(PackageManagerCore::Canceled, core->installSelectedComponentsSilently(QStringList() + << QLatin1String("B.subcomponent"))); + + QTest::ignoreMessage(QtDebugMsg, "Preparing meta information download..."); QTest::ignoreMessage(QtDebugMsg, "Cannot install MissingComponent. Component not found.\n"); QCOMPARE(PackageManagerCore::Canceled, core->installSelectedComponentsSilently(QStringList() << QLatin1String("MissingComponent"))); diff --git a/tests/auto/installer/factory/tst_factory.cpp b/tests/auto/installer/factory/tst_factory.cpp index f44a6febe..eb7e2c36c 100644 --- a/tests/auto/installer/factory/tst_factory.cpp +++ b/tests/auto/installer/factory/tst_factory.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -82,7 +82,7 @@ public: : Food(amount) , m_expireDate(expireDate) { qDebug().nospace().noquote() << "Constructor."; } - QDate expireDate() const { + QDate expireDate() const Q_DECL_OVERRIDE { return m_expireDate; } private: @@ -92,7 +92,7 @@ private: class Butter : public Food { public: - QDate expireDate() const { + QDate expireDate() const Q_DECL_OVERRIDE { return m_expireDate; } static Food *create(int amount, const QDate expireDate) { @@ -117,7 +117,7 @@ public: : Food(amount) , m_expireDate(expireDate) { qDebug().nospace().noquote() << "Constructor."; } - QDate expireDate() const { + QDate expireDate() const Q_DECL_OVERRIDE { return m_expireDate; } diff --git a/tests/auto/installer/metadatajob/data/config.xml b/tests/auto/installer/metadatajob/data/config.xml deleted file mode 100644 index 041ce5062..000000000 --- a/tests/auto/installer/metadatajob/data/config.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<Installer> - <Name>Your application</Name> - <Version>1.2.3</Version> - <MaintenanceToolName></MaintenanceToolName> - <MaintenanceToolIniFile></MaintenanceToolIniFile> - <TargetConfigurationFile></TargetConfigurationFile> -</Installer> diff --git a/tests/auto/installer/metadatajob/settings.qrc b/tests/auto/installer/metadatajob/settings.qrc index c881f294b..6e56a7854 100644 --- a/tests/auto/installer/metadatajob/settings.qrc +++ b/tests/auto/installer/metadatajob/settings.qrc @@ -1,6 +1,5 @@ <RCC> <qresource prefix="/"> - <file>data/config.xml</file> <file>data/repository/Updates.xml</file> <file>data/repositoryActionAdd/Updates.xml</file> <file>data/repositoryActionRemove/Updates.xml</file> diff --git a/tests/auto/installer/metadatajob/tst_metadatajob.cpp b/tests/auto/installer/metadatajob/tst_metadatajob.cpp index ef7b42940..54609ab95 100644 --- a/tests/auto/installer/metadatajob/tst_metadatajob.cpp +++ b/tests/auto/installer/metadatajob/tst_metadatajob.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -47,7 +47,6 @@ class tst_MetaDataJob : public QObject private slots: void testRepository() { - Settings settings = Settings::fromFileAndPrefix(":///data/config.xml", ":///data"); PackageManagerCore core; core.setInstaller(); QSet<Repository> repoList; @@ -63,7 +62,6 @@ private slots: void testRepositoryUpdateActionAdd() { - Settings settings = Settings::fromFileAndPrefix(":///data/config.xml", ":///data"); PackageManagerCore core; core.setInstaller(); QSet<Repository> repoList; @@ -82,7 +80,6 @@ private slots: void testRepositoryUpdateActionRemove() { - Settings settings = Settings::fromFileAndPrefix(":///data/config.xml", ":///data"); PackageManagerCore core; core.setInstaller(); QSet<Repository> repoList; diff --git a/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp b/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp index 17343e49d..a3e86c2f8 100644 --- a/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp +++ b/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -46,7 +46,7 @@ using namespace QInstaller; class DummyComponent : public Component { public: - DummyComponent(PackageManagerCore *core) + explicit DummyComponent(PackageManagerCore *core) : Component(core) { setCheckState(Qt::Checked); diff --git a/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp b/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp index 5a4377d7b..3e3005621 100644 --- a/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp +++ b/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -80,7 +80,6 @@ private slots: QInstaller::init(); QString randomString = ""; const QString possible = "abcdefghijklmnopqrstuvwxyz0123456789"; - qsrand(QTime::currentTime().msec()); for (int i = 0; i < 5; i++) { int index = QRandomGenerator::global()->generate() % possible.length(); QChar nextChar = possible.at(index); diff --git a/tests/auto/tools/repotest/tst_repotest.cpp b/tests/auto/tools/repotest/tst_repotest.cpp index 228c13c80..c467d21d2 100644 --- a/tests/auto/tools/repotest/tst_repotest.cpp +++ b/tests/auto/tools/repotest/tst_repotest.cpp @@ -44,7 +44,7 @@ private: { QStringList filteredPackages; - QInstallerTools::PackageInfoVector m_packages = QInstallerTools::collectPackages(m_repoInfo, + m_packages = QInstallerTools::collectPackages(m_repoInfo, &filteredPackages, QInstallerTools::Exclude, updateNewComponents, packagesUpdatedWithSha); if (updateNewComponents) { //Verify that component B exists as that is not updated |