diff options
author | Katja Marttila <katja.marttila@qt.io> | 2020-01-16 09:24:50 +0200 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2020-01-16 09:24:50 +0200 |
commit | 0b62a4c042c2ab191ba06fdc09ca5d9a88ef2995 (patch) | |
tree | 22acb22aaf9495fc07f03f4c487c458f62e327f8 /tests/auto | |
parent | 55ccd0b3f9cfbfdd550f0b671150c11a5b8cdd25 (diff) | |
parent | a45524be8c8cc74f168a479653a04f97b1689def (diff) |
Merge remote-tracking branch 'origin/3.2' into master
Change-Id: Ie42b694119ecaa59c9df4aa0253663107ef0c68c
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/installer/installer.pro | 3 | ||||
-rw-r--r-- | tests/auto/installer/solver/tst_solver.cpp | 25 |
2 files changed, 8 insertions, 20 deletions
diff --git a/tests/auto/installer/installer.pro b/tests/auto/installer/installer.pro index cf6218698..89f59c6f7 100644 --- a/tests/auto/installer/installer.pro +++ b/tests/auto/installer/installer.pro @@ -23,7 +23,8 @@ SUBDIRS += \ task \ clientserver \ factory \ - replaceoperation + replaceoperation \ + brokeninstaller win32 { SUBDIRS += registerfiletypeoperation diff --git a/tests/auto/installer/solver/tst_solver.cpp b/tests/auto/installer/solver/tst_solver.cpp index 139aa7581..d1c3aaa14 100644 --- a/tests/auto/installer/solver/tst_solver.cpp +++ b/tests/auto/installer/solver/tst_solver.cpp @@ -153,17 +153,13 @@ private slots: NamedComponent *componentA = new NamedComponent(core, QLatin1String("A")); NamedComponent *componentAA = new NamedComponent(core, QLatin1String("A.A")); NamedComponent *componentAB = new NamedComponent(core, QLatin1String("A.B")); - NamedComponent *componentABC = new NamedComponent(core, QLatin1String("A.B.C")); - NamedComponent *componentABD = new NamedComponent(core, QLatin1String("A.B.D")); componentA->appendComponent(componentAA); componentA->appendComponent(componentAB); - componentAB->appendComponent(componentABC); - componentAB->appendComponent(componentABD); NamedComponent *componentB = new NamedComponent(core, QLatin1String("B")); NamedComponent *componentB_NewVersion = new NamedComponent(core, QLatin1String("B_version"), QLatin1String("2.0.0")); NamedComponent *componentB_Auto = new NamedComponent(core, QLatin1String("B_auto")); - componentB->addDependency(QLatin1String("A.B.C")); - componentABC->addDependency(QLatin1String("B_version->=2.0.0")); + componentB->addDependency(QLatin1String("A.B")); + componentAB->addDependency(QLatin1String("B_version->=2.0.0")); componentB_Auto->addAutoDependOn(QLatin1String("B_version")); core->appendRootComponent(componentA); core->appendRootComponent(componentB); @@ -172,12 +168,10 @@ private slots: QTest::newRow("Installer resolved") << core << (QList<Component *>() << componentB) - << (QList<Component *>() << componentA << componentAB << componentABC << componentB_NewVersion << componentB << componentB_Auto) + << (QList<Component *>() << componentB_NewVersion << componentAB << componentB << componentB_Auto) << (QList<int>() << InstallerCalculator::Dependent << InstallerCalculator::Dependent - << InstallerCalculator::Dependent - << InstallerCalculator::Dependent << InstallerCalculator::Resolved << InstallerCalculator::Automatic); } @@ -192,19 +186,12 @@ private slots: InstallerCalculator calc(core->components(PackageManagerCore::ComponentType::AllNoReplacements)); calc.appendComponentsToInstall(selectedComponents); QList<Component *> result = calc.orderedComponentsToInstall(); - int results = 0; + QCOMPARE(result.count(), expectedResult.count()); for (int i = 0; i < result.count(); i++) { - if (result.contains(expectedResult.at(i))) { - int index = result.indexOf(expectedResult.at(i)); - QCOMPARE(result.at(index), expectedResult.at(i)); - QCOMPARE((int)calc.installReasonType(result.at(index)), installReason.at(i)); - results++; - } + QCOMPARE(result.at(i), expectedResult.at(i)); + QCOMPARE((int)calc.installReasonType(result.at(i)), installReason.at(i)); } - // Check that we have found all expected results. Install order may vary - // for dependent components so we cannot do a direct compare - QCOMPARE(result.count(), results); delete core; } |