diff options
Diffstat (limited to 'tests')
7 files changed, 35 insertions, 4 deletions
diff --git a/tests/auto/installer/cliinterface/data/componentsFromInstallPackagesRepository.xml b/tests/auto/installer/cliinterface/data/componentsFromInstallPackagesRepository.xml index 90d14c93e..18d6f11c3 100644 --- a/tests/auto/installer/cliinterface/data/componentsFromInstallPackagesRepository.xml +++ b/tests/auto/installer/cliinterface/data/componentsFromInstallPackagesRepository.xml @@ -145,4 +145,16 @@ <Virtual>true</Virtual> <Checkable>true</Checkable> </Package> + <Package> + <Name>componentI</Name> + <Title>Component I</Title> + <Description>This component has an automatic dependency on Component C. If C is marked for installation, this component is also installed.</Description> + <Version>1.0.0</Version> + <LastUpdateDate></LastUpdateDate> + <InstallDate>2020-03-23</InstallDate> + <Size>99</Size> + <AutoDependOn>componentC</AutoDependOn> + <Virtual>true</Virtual> + <Checkable>true</Checkable> + </Package> </Packages> diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/Updates.xml b/tests/auto/installer/cliinterface/data/installPackagesRepository/Updates.xml index e61b11189..adabceab4 100644 --- a/tests/auto/installer/cliinterface/data/installPackagesRepository/Updates.xml +++ b/tests/auto/installer/cliinterface/data/installPackagesRepository/Updates.xml @@ -158,4 +158,14 @@ <DownloadableArchives>content.7z</DownloadableArchives> <Virtual>true</Virtual> </PackageUpdate> + <PackageUpdate> + <Name>componentI</Name> + <Description>This component has an automatic dependency on Component C. If C is marked for installation, this component is also installed.</Description> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <SortingPriority>50</SortingPriority> + <AutoDependOn>componentC</AutoDependOn> + <DownloadableArchives>content.7z</DownloadableArchives> + <Virtual>true</Virtual> + </PackageUpdate> </Updates> diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentI/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentI/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..651a29f94 --- /dev/null +++ b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentI/1.0.0content.7z diff --git a/tests/auto/installer/cliinterface/settings.qrc b/tests/auto/installer/cliinterface/settings.qrc index 2278f42d0..6b46aaffd 100644 --- a/tests/auto/installer/cliinterface/settings.qrc +++ b/tests/auto/installer/cliinterface/settings.qrc @@ -13,6 +13,7 @@ <file>data/installPackagesRepository/componentF/1.0.0content.7z</file> <file>data/installPackagesRepository/componentG/1.0.0content.7z</file> <file>data/installPackagesRepository/componentH/1.0.0content.7z</file> + <file>data/installPackagesRepository/componentI/1.0.0content.7z</file> <file>data/installPackagesRepository/componentG/1.0.0meta.7z</file> <file>data/installPackagesRepository/componentF.subcomponent1/1.0.0content.7z</file> <file>data/installPackagesRepository/componentF.subcomponent2/1.0.0content.7z</file> diff --git a/tests/auto/installer/cliinterface/tst_cliinterface.cpp b/tests/auto/installer/cliinterface/tst_cliinterface.cpp index 08214a906..a9af9545d 100644 --- a/tests/auto/installer/cliinterface/tst_cliinterface.cpp +++ b/tests/auto/installer/cliinterface/tst_cliinterface.cpp @@ -166,6 +166,10 @@ private slots: QTest::ignoreMessage(QtDebugMsg, "Id: A"); QTest::ignoreMessage(QtDebugMsg, "Id: B"); core.listInstalledPackages(); + + QTest::ignoreMessage(QtDebugMsg, "Id: A"); + core.listInstalledPackages(QLatin1String("A")); + QDir dir(testDirectory); QVERIFY(dir.removeRecursively()); } @@ -267,10 +271,11 @@ private slots: VerifyInstaller::verifyInstallerResources(m_installDir, "componentB", "1.0.0content.txt"); //Dependency for componentC VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Depends on componentA + VerifyInstaller::verifyInstallerResources(m_installDir, "componentI", "1.0.0content.txt"); //Virtual, depends on componentC VerifyInstaller::verifyInstallerResources(m_installDir, "componentD", "1.0.0content.txt"); //Autodepend on componentA and componentB VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontentC.txt" << "installcontent.txt" << "installcontentA.txt" << "installcontentB.txt" - << "installcontentD.txt"<< "installcontentE.txt" << "installcontentG.txt"); + << "installcontentD.txt"<< "installcontentE.txt" << "installcontentG.txt" << "installcontentI.txt"); } void testUninstallWithDependencySilently() @@ -281,7 +286,7 @@ private slots: << QLatin1String("componentC"))); VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontentC.txt" << "installcontent.txt" << "installcontentA.txt" << "installcontentB.txt" - << "installcontentD.txt"<< "installcontentE.txt" << "installcontentG.txt"); + << "installcontentD.txt"<< "installcontentE.txt" << "installcontentG.txt" << "installcontentI.txt"); core->commitSessionOperations(); core->setPackageManager(); @@ -294,6 +299,7 @@ private slots: VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Depends on componentA VerifyInstaller::verifyInstallerResources(m_installDir, "componentD", "1.0.0content.txt"); //Autodepend on componentA and componentB VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentC"); + VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentI"); //Virtual, depends on componentC VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontent.txt" << "installcontentA.txt" << "installcontentB.txt" << "installcontentD.txt"<< "installcontentE.txt" << "installcontentG.txt"); diff --git a/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp b/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp index bbe391a0a..4d14a2753 100644 --- a/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp +++ b/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp @@ -37,6 +37,7 @@ #include <QTextStream> #include <QSettings> #include <QtGlobal> +#include <QRandomGenerator> #include "qsettingswrapper.h" @@ -73,7 +74,7 @@ private slots: const QString possible = "abcdefghijklmnopqrstuvwxyz0123456789"; qsrand(QTime::currentTime().msec()); for (int i = 0; i < 5; i++) { - int index = qrand() % possible.length(); + int index = QRandomGenerator::global()->generate() % possible.length(); QChar nextChar = possible.at(index); randomString.append(nextChar); diff --git a/tests/auto/installer/replaceoperation/tst_replaceoperation.cpp b/tests/auto/installer/replaceoperation/tst_replaceoperation.cpp index 88dc2011b..33bd2b6c1 100644 --- a/tests/auto/installer/replaceoperation/tst_replaceoperation.cpp +++ b/tests/auto/installer/replaceoperation/tst_replaceoperation.cpp @@ -34,6 +34,7 @@ #include <QDir> #include <QFile> #include <QTest> +#include <QRandomGenerator> using namespace KDUpdater; using namespace QInstaller; @@ -46,7 +47,7 @@ private slots: void initTestCase() { m_testDirectory = QInstaller::generateTemporaryFileName(); - m_testFilePath = m_testDirectory + "/test." + QString::number(qrand() % 1000); + m_testFilePath = m_testDirectory + "/test." + QString::number(QRandomGenerator::global()->generate() % 1000); } void testWrongArguments() |