summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/installer/treename/data/invalid_repository/Updates.xml10
-rw-r--r--tests/auto/installer/treename/tst_treename.cpp21
2 files changed, 17 insertions, 14 deletions
diff --git a/tests/auto/installer/treename/data/invalid_repository/Updates.xml b/tests/auto/installer/treename/data/invalid_repository/Updates.xml
index a9542eb0d..282e3a43f 100644
--- a/tests/auto/installer/treename/data/invalid_repository/Updates.xml
+++ b/tests/auto/installer/treename/data/invalid_repository/Updates.xml
@@ -9,10 +9,6 @@
<Version>1.0.0</Version>
<ReleaseDate>2014-08-25</ReleaseDate>
<SortingPriority>80</SortingPriority>
- <Dependencies>componentB.sub2</Dependencies>
- <UpdateFile CompressedSize="275" UncompressedSize="101" OS="Any"/>
- <DownloadableArchives>content.7z</DownloadableArchives>
- <SHA1>570dec768b1f266c66656f015e772f0e6e41b73d</SHA1>
</PackageUpdate>
<PackageUpdate>
<Name>componentA.sub1</Name>
@@ -21,9 +17,6 @@
<Version>1.0.0</Version>
<ReleaseDate>2014-08-25</ReleaseDate>
<SortingPriority>80</SortingPriority>
- <UpdateFile CompressedSize="283" UncompressedSize="101" OS="Any"/>
- <DownloadableArchives>content.7z</DownloadableArchives>
- <SHA1>da5819910a7f7c95eb61a49543e273fd6e2e9aae</SHA1>
</PackageUpdate>
<PackageUpdate>
<Name>componentB</Name>
@@ -32,9 +25,6 @@
<Version>1.0.0</Version>
<ReleaseDate>2014-08-25</ReleaseDate>
<SortingPriority>40</SortingPriority>
- <UpdateFile CompressedSize="275" UncompressedSize="101" OS="Any"/>
- <DownloadableArchives>content.7z</DownloadableArchives>
- <SHA1>72eee5304ff866e024b477d7b2432df8f2428483</SHA1>
<TreeName>componentA.sub1</TreeName>
</PackageUpdate>
</Updates>
diff --git a/tests/auto/installer/treename/tst_treename.cpp b/tests/auto/installer/treename/tst_treename.cpp
index b7a511ffb..58d005848 100644
--- a/tests/auto/installer/treename/tst_treename.cpp
+++ b/tests/auto/installer/treename/tst_treename.cpp
@@ -44,7 +44,8 @@ private slots:
void moveToSubItem();
void dependencyToMovedItem();
void autodependOnMovedItem();
- void moveToExistingItem();
+ void moveToExistingItemAllowUnstableComponents();
+ void moveToExistingItemNoUnstableComponents();
void init();
void cleanup();
@@ -111,12 +112,24 @@ void tst_TreeName::autodependOnMovedItem()
<< "componentASub2.txt" << "componentD.txt");
}
-void tst_TreeName::moveToExistingItem()
+void tst_TreeName::moveToExistingItemAllowUnstableComponents()
{
QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit
(m_installDir, ":///data/invalid_repository"));
- QCOMPARE(PackageManagerCore::Failure, core->installSelectedComponentsSilently(QStringList() << "componentA"));
- QCOMPARE(core->error(), "Cannot register component! Component with identifier componentA.sub1 already exists.");
+ core->settings().setAllowUnstableComponents(true);
+
+ QCOMPARE(PackageManagerCore::Success, core->installSelectedComponentsSilently(QStringList() << "componentA"));
+ QVERIFY(core->componentByName("componentB")->isUnstable());
+}
+
+void tst_TreeName::moveToExistingItemNoUnstableComponents()
+{
+ QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit
+ (m_installDir, ":///data/invalid_repository"));
+ core->settings().setAllowUnstableComponents(false);
+
+ QCOMPARE(PackageManagerCore::Success, core->installSelectedComponentsSilently(QStringList() << "componentA"));
+ QVERIFY(!core->componentByName("componentB"));
}
void tst_TreeName::init()