mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-14 22:35:49 +00:00
add tests for battery and gpuload sources
+ some tests refactoring
This commit is contained in:
@ -53,9 +53,6 @@ void TestExtQuotes::test_run()
|
||||
// init spy
|
||||
QSignalSpy spy(extQuotes, SIGNAL(dataReceived(const QVariantHash &)));
|
||||
QVariantHash firstValue = extQuotes->run();
|
||||
QCOMPARE(firstValue[extQuotes->tag(QString("ask"))].toDouble(), 0.0);
|
||||
QCOMPARE(firstValue[extQuotes->tag(QString("bid"))].toDouble(), 0.0);
|
||||
QCOMPARE(firstValue[extQuotes->tag(QString("price"))].toDouble(), 0.0);
|
||||
|
||||
// check values
|
||||
QVERIFY(spy.wait(5000));
|
||||
@ -67,6 +64,9 @@ void TestExtQuotes::test_run()
|
||||
cache[QString("price")]
|
||||
= arguments.at(0).toHash()[extQuotes->tag(QString("price"))];
|
||||
|
||||
QCOMPARE(firstValue[extQuotes->tag(QString("ask"))].toDouble(), 0.0);
|
||||
QCOMPARE(firstValue[extQuotes->tag(QString("bid"))].toDouble(), 0.0);
|
||||
QCOMPARE(firstValue[extQuotes->tag(QString("price"))].toDouble(), 0.0);
|
||||
for (auto type : types) {
|
||||
qDebug() << "Test type" << type;
|
||||
QVERIFY((cache[type].toDouble() > price.first)
|
||||
|
Reference in New Issue
Block a user