add tests for battery and gpuload sources

+ some tests refactoring
This commit is contained in:
2016-06-09 12:45:21 +03:00
parent bc2071a493
commit 78b7a87c29
16 changed files with 269 additions and 44 deletions

View File

@ -57,11 +57,12 @@ void TestExtUpgrade::test_run()
// init spy
QSignalSpy spy(extUpgrade, SIGNAL(dataReceived(const QVariantHash &)));
QVariantHash firstValue = extUpgrade->run();
QCOMPARE(firstValue[extUpgrade->tag(QString("pkgcount"))].toInt(), 0);
// check values
QVERIFY(spy.wait(5000));
QList<QVariant> arguments = spy.takeFirst();
QCOMPARE(firstValue[extUpgrade->tag(QString("pkgcount"))].toInt(), 0);
QCOMPARE(
arguments.at(0).toHash()[extUpgrade->tag(QString("pkgcount"))].toInt(),
randomStrings.count());