test adding files/directories to copied Package object

This commit is contained in:
Aaron Seigo 2014-08-08 07:22:31 +02:00
parent cbec4fda2d
commit bc571d98e2

View File

@ -74,6 +74,8 @@ void PackageStructureTest::mutateAfterCopy()
const bool externalPaths = ps.allowExternalPaths();
const QString servicePrefix = ps.servicePrefix();
const QStringList contentsPrefixPaths = ps.contentsPrefixPaths();
const QList<const char *> files = ps.files();
const QList<const char *> dirs = ps.directories();
Plasma::Package copy(ps);
@ -105,6 +107,16 @@ void PackageStructureTest::mutateAfterCopy()
QCOMPARE(ps.contentsPrefixPaths(), contentsPrefixPaths);
QCOMPARE(copy.contentsPrefixPaths(), copyContentsPrefixPaths);
copy = ps;
copy.addFileDefinition("nonsense", "foobar", QString());
QCOMPARE(ps.files(), files);
QVERIFY(ps.files() != copy.files());
copy = ps;
copy.addDirectoryDefinition("nonsense", "foobar", QString());
QCOMPARE(ps.directories(), dirs);
QVERIFY(ps.directories() != copy.directories());
#ifndef PLASMA_NO_PACKAGE_EXTRADATA
copy = ps;
QVERIFY(!imageMimeTypes.isEmpty());