mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-13 13:55:50 +00:00
add tests for battery and gpuload sources
+ some tests refactoring
This commit is contained in:
@ -60,12 +60,13 @@ void TestHDDTemperatureSource::test_hddtemp()
|
||||
QSignalSpy spy(hddtempSource,
|
||||
SIGNAL(dataReceived(const QVariantHash &)));
|
||||
float firstValue = hddtempSource->data(device).toFloat();
|
||||
QCOMPARE(firstValue, 0.0f);
|
||||
|
||||
QVERIFY(spy.wait(5000));
|
||||
QVariantHash arguments = spy.takeFirst().at(0).toHash();
|
||||
device.remove(QString("hdd/temperature"));
|
||||
float secondValue = arguments[device].toFloat();
|
||||
|
||||
QCOMPARE(firstValue, 0.0f);
|
||||
QVERIFY((secondValue >= temp.first) && (secondValue <= temp.second));
|
||||
});
|
||||
}
|
||||
@ -77,12 +78,13 @@ void TestHDDTemperatureSource::test_smartctl()
|
||||
QSignalSpy spy(smartctlSource,
|
||||
SIGNAL(dataReceived(const QVariantHash &)));
|
||||
float firstValue = smartctlSource->data(device).toFloat();
|
||||
QCOMPARE(firstValue, 0.0f);
|
||||
|
||||
QVERIFY(spy.wait(5000));
|
||||
QVariantHash arguments = spy.takeFirst().at(0).toHash();
|
||||
device.remove(QString("hdd/temperature"));
|
||||
float secondValue = arguments[device].toFloat();
|
||||
|
||||
QCOMPARE(firstValue, 0.0f);
|
||||
QVERIFY((secondValue >= temp.first) && (secondValue <= temp.second));
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user