From 27cc67b75373905931448c3228e20a6c8d0797e6 Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Thu, 31 Jan 2013 18:13:12 +0100 Subject: Add a QAmbientTemperatureSensor class. Port the Blackberry backend to use it. Change-Id: I6d4395f5ab9e0ce3fb6f76c47282929103929557 Reviewed-by: Lorn Potter --- tests/auto/qsensor/test_backends.h | 4 ++++ tests/auto/qsensor/tst_qsensor.cpp | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/auto/qsensor/test_backends.h b/tests/auto/qsensor/test_backends.h index 6a04df72..b76d4128 100644 --- a/tests/auto/qsensor/test_backends.h +++ b/tests/auto/qsensor/test_backends.h @@ -50,6 +50,7 @@ void unregister_test_backends(); #include #include #include +#include #include #include #include @@ -105,6 +106,9 @@ PREPARE_SENSORINTERFACE(QAltimeter, QAltimeterReading, QAltimeterFilter, { PREPARE_SENSORINTERFACE(QAmbientLightSensor, QAmbientLightReading, QAmbientLightFilter, { reading->setLightLevel(QAmbientLightReading::Twilight); }) +PREPARE_SENSORINTERFACE(QAmbientTemperatureSensor, QAmbientTemperatureReading, QAmbientTemperatureFilter, { + reading->setTemperature(30); +}) PREPARE_SENSORINTERFACE(QCompass, QCompassReading, QCompassFilter, { reading->setAzimuth(1.0); reading->setCalibrationLevel(1.0); diff --git a/tests/auto/qsensor/tst_qsensor.cpp b/tests/auto/qsensor/tst_qsensor.cpp index 232590c7..a410f711 100644 --- a/tests/auto/qsensor/tst_qsensor.cpp +++ b/tests/auto/qsensor/tst_qsensor.cpp @@ -855,6 +855,10 @@ private slots: QCOMPARE(reading->lightLevel(), QAmbientLightReading::Twilight); }) + TEST_SENSORINTERFACE(QAmbientTemperatureSensor, QAmbientTemperatureReading, { + QCOMPARE(reading->temperature(), 30.0); + }) + TEST_SENSORINTERFACE(QCompass, QCompassReading, { QCOMPARE(reading->azimuth(), 1.0); QCOMPARE(reading->calibrationLevel(), 1.0); -- cgit v1.2.3