summaryrefslogtreecommitdiffstats
path: root/tests/auto/qsensor
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qsensor')
-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);