summaryrefslogtreecommitdiffstats
path: root/tests/auto/qsystemdeviceinfo/tst_qsystemdeviceinfo.cpp
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@nokia.com>2009-09-15 08:09:07 +1000
committerLorn Potter <lorn.potter@nokia.com>2009-09-15 08:09:07 +1000
commit811c60d97a3ca99df45d9c364f298851ebd9c25a (patch)
treeba1caa05a5a675fdb223fca41871e963460f5c7e /tests/auto/qsystemdeviceinfo/tst_qsystemdeviceinfo.cpp
parent6e72d53c921ac7d1f70560bea72d11d1e13b3545 (diff)
remove isBatteryCharging in favor of adding WallPowerChargingBattery to
PowerState.
Diffstat (limited to 'tests/auto/qsystemdeviceinfo/tst_qsystemdeviceinfo.cpp')
-rw-r--r--tests/auto/qsystemdeviceinfo/tst_qsystemdeviceinfo.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/tests/auto/qsystemdeviceinfo/tst_qsystemdeviceinfo.cpp b/tests/auto/qsystemdeviceinfo/tst_qsystemdeviceinfo.cpp
index c443d2ee6d..cda62821c5 100644
--- a/tests/auto/qsystemdeviceinfo/tst_qsystemdeviceinfo.cpp
+++ b/tests/auto/qsystemdeviceinfo/tst_qsystemdeviceinfo.cpp
@@ -56,8 +56,6 @@ private slots:
void tst_model();
void tst_productName();
- void tst_isBatteryCharging();
-
void tst_batteryLevel();
void tst_batteryStatus();
@@ -135,20 +133,12 @@ void tst_QSystemDeviceInfo::tst_productName()
}
-void tst_QSystemDeviceInfo::tst_isBatteryCharging()
-{
- QSystemDeviceInfo di;
- QVERIFY(di.isBatteryCharging() == true
- || di.isBatteryCharging() == false);
-
-}
-
void tst_QSystemDeviceInfo::tst_batteryLevel()
{
QSystemDeviceInfo di;
QVERIFY(di.batteryLevel() > -1);
- if(di.isBatteryCharging()) {
+ if(di.currentPowerState() == QSystemDeviceInfo::WallPowerChargingBattery) {
QSignalSpy batSpy(&di, SIGNAL(batteryLevelChanged(int)));
QVERIFY(!batSpy.isEmpty());
int level = batSpy.first().at(0).toInt();
@@ -170,7 +160,7 @@ void tst_QSystemDeviceInfo::tst_batteryStatus()
QVERIFY(di.batteryStatus() == QSystemDeviceInfo::BatteryNormal);
}
- if(di.isBatteryCharging()) {
+ if(di.currentPowerState() == QSystemDeviceInfo::WallPowerChargingBattery) {
QSignalSpy batSpy(&di, SIGNAL(batteryStatusChanged(QSystemDeviceInfo::BatteryStatus)));
QVERIFY(!batSpy.isEmpty());
QSystemDeviceInfo::BatteryStatus status = qvariant_cast<QSystemDeviceInfo::BatteryStatus>(batSpy.first().at(0));
@@ -217,7 +207,8 @@ void tst_QSystemDeviceInfo::tst_currentPowerState()
QSystemDeviceInfo::PowerState state = di.currentPowerState();
QVERIFY( state == QSystemDeviceInfo::UnknownPower
|| state == QSystemDeviceInfo::BatteryPower
- || state == QSystemDeviceInfo::WallPower);
+ || state == QSystemDeviceInfo::WallPower
+ || state == QSystemDeviceInfo::WallPowerChargingBattery);
}