summaryrefslogtreecommitdiffstats
path: root/tests/auto/installer/fakestopprocessforupdateoperation/tst_fakestopprocessforupdateoperation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/installer/fakestopprocessforupdateoperation/tst_fakestopprocessforupdateoperation.cpp')
-rw-r--r--tests/auto/installer/fakestopprocessforupdateoperation/tst_fakestopprocessforupdateoperation.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/tests/auto/installer/fakestopprocessforupdateoperation/tst_fakestopprocessforupdateoperation.cpp b/tests/auto/installer/fakestopprocessforupdateoperation/tst_fakestopprocessforupdateoperation.cpp
index c8b314657..583bb26f0 100644
--- a/tests/auto/installer/fakestopprocessforupdateoperation/tst_fakestopprocessforupdateoperation.cpp
+++ b/tests/auto/installer/fakestopprocessforupdateoperation/tst_fakestopprocessforupdateoperation.cpp
@@ -15,20 +15,20 @@ class tst_FakeStopProcessForUpdateOperation : public QObject
private slots:
void testMissingArgument()
{
- FakeStopProcessForUpdateOperation op;
- op.setValue(QLatin1String("installer"), QVariant::fromValue(&m_core));
+ FakeStopProcessForUpdateOperation op(&m_core);
QVERIFY(op.testOperation());
QVERIFY(op.performOperation());
QVERIFY(!op.undoOperation());
QCOMPARE(UpdateOperation::Error(op.error()), UpdateOperation::InvalidArguments);
- QCOMPARE(op.errorString(), QString("Number of arguments does not match: one is required"));
+ QCOMPARE(op.errorString(), QString("Invalid arguments in FakeStopProcessForUpdate: "
+ "0 arguments given, exactly 1 arguments expected."));
}
void testMissingPackageManagerCore()
{
- FakeStopProcessForUpdateOperation op;
+ FakeStopProcessForUpdateOperation op(0);
op.setArguments(QStringList() << QFileInfo(QCoreApplication::applicationFilePath()).fileName());
QVERIFY(op.testOperation());
@@ -36,16 +36,15 @@ private slots:
QVERIFY(!op.undoOperation());
QCOMPARE(UpdateOperation::Error(op.error()), UpdateOperation::UserDefinedError);
- QCOMPARE(op.errorString(), QString("Could not get package manager core."));
+ QCOMPARE(op.errorString(), QString("Cannot get package manager core."));
}
void testRunningApplication()
{
const QString app = QFileInfo(QCoreApplication::applicationFilePath()).fileName();
- FakeStopProcessForUpdateOperation op;
+ FakeStopProcessForUpdateOperation op(&m_core);
op.setArguments(QStringList() << app);
- op.setValue(QLatin1String("installer"), QVariant::fromValue(&m_core));
QVERIFY(op.testOperation());
QVERIFY(op.performOperation());
@@ -58,9 +57,8 @@ private slots:
void testRunningNonApplication()
{
- FakeStopProcessForUpdateOperation op;
+ FakeStopProcessForUpdateOperation op(&m_core);
op.setArguments(QStringList() << "dummy.exe");
- op.setValue(QLatin1String("installer"), QVariant::fromValue(&m_core));
QVERIFY(op.testOperation());
QVERIFY(op.performOperation());