mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-09 20:05:51 +00:00
add tests for dekstop, network and processes sources
This commit is contained in:
@ -48,13 +48,15 @@ void TestBatterySource::test_battery()
|
||||
QSKIP("No battery found, test will be skipped");
|
||||
|
||||
QStringList batteries = source->sources();
|
||||
std::for_each(batteries.begin(), batteries.end(), [this](const QString bat) {
|
||||
QVariant value = source->data(bat);
|
||||
if (bat == QString("battery/ac"))
|
||||
QCOMPARE(value.type(), QVariant::Bool);
|
||||
else
|
||||
QVERIFY((value.toFloat() >= battery.first) && (value.toFloat() <= battery.second));
|
||||
});
|
||||
std::for_each(batteries.begin(), batteries.end(),
|
||||
[this](const QString bat) {
|
||||
QVariant value = source->data(bat);
|
||||
if (bat == QString("battery/ac"))
|
||||
QCOMPARE(value.type(), QVariant::Bool);
|
||||
else
|
||||
QVERIFY((value.toFloat() >= battery.first)
|
||||
&& (value.toFloat() <= battery.second));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user