summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire.qnx@kdab.com>2013-01-31 18:13:12 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-08 11:17:53 +0100
commit27cc67b75373905931448c3228e20a6c8d0797e6 (patch)
tree094faff84d478c3d74764e3b87e26d4843bbeca2 /tests
parent2dba878107fbe290782af720981ce28ec3723e7a (diff)
Add a QAmbientTemperatureSensor class.
Port the Blackberry backend to use it. Change-Id: I6d4395f5ab9e0ce3fb6f76c47282929103929557 Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qsensor/test_backends.h4
-rw-r--r--tests/auto/qsensor/tst_qsensor.cpp4
2 files changed, 8 insertions, 0 deletions
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 <qaccelerometer.h>
#include <qaltimeter.h>
#include <qambientlightsensor.h>
+#include <qambienttemperaturesensor.h>
#include <qcompass.h>
#include <qgyroscope.h>
#include <qholstersensor.h>
@@ -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);